home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / ct_ocx / ct_slide.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-30  |  11.0 KB  |  354 lines

  1. VERSION 4.00
  2. Begin VB.Form w_slide_demo 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "ctSlide (Slider Control) Demo"
  5.    ClientHeight    =   6525
  6.    ClientLeft      =   1380
  7.    ClientTop       =   1470
  8.    ClientWidth     =   9420
  9.    Height          =   6930
  10.    Icon            =   "ct_slide.frx":0000
  11.    Left            =   1320
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MDIChild        =   -1  'True
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6525
  17.    ScaleWidth      =   9420
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   1125
  20.    Width           =   9540
  21.    Begin VB.CommandButton Command1 
  22.       Caption         =   "E&xit"
  23.       Height          =   495
  24.       Left            =   8040
  25.       TabIndex        =   11
  26.       Top             =   5820
  27.       Width           =   1035
  28.    End
  29.    Begin VB.Frame Frame1 
  30.       Caption         =   "Time"
  31.       BeginProperty Font 
  32.          name            =   "MS Sans Serif"
  33.          charset         =   0
  34.          weight          =   700
  35.          size            =   8.25
  36.          underline       =   0   'False
  37.          italic          =   0   'False
  38.          strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   735
  41.       Left            =   3060
  42.       TabIndex        =   10
  43.       Top             =   2280
  44.       Width           =   2475
  45.       Begin VB.OptionButton rb_pm 
  46.          Caption         =   "P.M."
  47.          Height          =   255
  48.          Left            =   1380
  49.          TabIndex        =   13
  50.          Top             =   300
  51.          Value           =   -1  'True
  52.          Width           =   915
  53.       End
  54.       Begin VB.OptionButton rb_am 
  55.          Caption         =   "A.M."
  56.          Height          =   255
  57.          Left            =   240
  58.          TabIndex        =   12
  59.          Top             =   300
  60.          Width           =   855
  61.       End
  62.    End
  63.    Begin FrameLibCtl.ctFrame uo_color 
  64.       Height          =   915
  65.       Left            =   2940
  66.       TabIndex        =   8
  67.       Top             =   4560
  68.       Width           =   1575
  69.       _version        =   65536
  70.       _extentx        =   2778
  71.       _extenty        =   1614
  72.       _stockprops     =   32
  73.       backcolor       =   0
  74.       bordercolor     =   16777215
  75.    End
  76.    Begin VB.Label Label6 
  77.       Caption         =   "Move the thumb on the top slider to change the selected time"
  78.       ForeColor       =   &H00800000&
  79.       Height          =   555
  80.       Left            =   3060
  81.       TabIndex        =   18
  82.       Top             =   1620
  83.       Width           =   2595
  84.    End
  85.    Begin VB.Label lbl_time 
  86.       BackColor       =   &H00FFFFFF&
  87.       BorderStyle     =   1  'Fixed Single
  88.       Caption         =   "12:00 P.M."
  89.       Height          =   375
  90.       Left            =   4560
  91.       TabIndex        =   17
  92.       Top             =   3300
  93.       Width           =   1035
  94.    End
  95.    Begin VB.Label Label4 
  96.       Caption         =   "Time Selected :"
  97.       BeginProperty Font 
  98.          name            =   "MS Sans Serif"
  99.          charset         =   0
  100.          weight          =   700
  101.          size            =   8.25
  102.          underline       =   0   'False
  103.          italic          =   0   'False
  104.          strikethrough   =   0   'False
  105.       EndProperty
  106.       Height          =   315
  107.       Left            =   3060
  108.       TabIndex        =   16
  109.       Top             =   3300
  110.       Width           =   1515
  111.    End
  112.    Begin VB.Label Label3 
  113.       Caption         =   "The slider control to the left is an example of replacing the controls standard background and thumb image with our own bitmaps"
  114.       BeginProperty Font 
  115.          name            =   "MS Sans Serif"
  116.          charset         =   0
  117.          weight          =   400
  118.          size            =   9.75
  119.          underline       =   0   'False
  120.          italic          =   0   'False
  121.          strikethrough   =   0   'False
  122.       EndProperty
  123.       Height          =   2115
  124.       Left            =   7560
  125.       TabIndex        =   15
  126.       Top             =   1740
  127.       Width           =   1575
  128.    End
  129.    Begin SlideLib.ctSlide ctSlide2 
  130.       Height          =   4695
  131.       Left            =   6720
  132.       TabIndex        =   14
  133.       Top             =   1620
  134.       Width           =   555
  135.       _version        =   65536
  136.       _extentx        =   979
  137.       _extenty        =   8281
  138.       _stockprops     =   68
  139.       outerborder     =   1
  140.       sliderstyle     =   1
  141.       thumbstyle      =   3
  142.       slidertype      =   2
  143.       innerbottom     =   0
  144.       innerleft       =   0
  145.       innerright      =   0
  146.       innertop        =   0
  147.       slideroffset    =   8
  148.       pictureback     =   "ct_slide.frx":030A
  149.       picturethumb    =   "ct_slide.frx":0F5C
  150.       innercolor      =   12632256
  151.    End
  152.    Begin VB.Label Label2 
  153.       Caption         =   "Click on any of the thumbs and then adjust the slider control to change the box color"
  154.       Height          =   675
  155.       Left            =   2940
  156.       TabIndex        =   9
  157.       Top             =   5640
  158.       Width           =   2475
  159.    End
  160.    Begin VB.Label lbl_blue 
  161.       Alignment       =   2  'Center
  162.       BackColor       =   &H00FFFFFF&
  163.       BorderStyle     =   1  'Fixed Single
  164.       Caption         =   "0"
  165.       Height          =   315
  166.       Left            =   1920
  167.       TabIndex        =   7
  168.       Top             =   5940
  169.       Width           =   735
  170.    End
  171.    Begin VB.Label lbl_green 
  172.       Alignment       =   2  'Center
  173.       BackColor       =   &H00FFFFFF&
  174.       BorderStyle     =   1  'Fixed Single
  175.       Caption         =   "0"
  176.       Height          =   315
  177.       Left            =   1080
  178.       TabIndex        =   6
  179.       Top             =   5940
  180.       Width           =   735
  181.    End
  182.    Begin VB.Label lbl_red 
  183.       Alignment       =   2  'Center
  184.       BackColor       =   &H00FFFFFF&
  185.       BorderStyle     =   1  'Fixed Single
  186.       Caption         =   "0"
  187.       Height          =   315
  188.       Left            =   240
  189.       TabIndex        =   5
  190.       Top             =   5940
  191.       Width           =   735
  192.    End
  193.    Begin VB.Label Label1 
  194.       Alignment       =   2  'Center
  195.       Caption         =   $"ct_slide.frx":12AE
  196.       BeginProperty Font 
  197.          name            =   "MS Sans Serif"
  198.          charset         =   0
  199.          weight          =   700
  200.          size            =   8.25
  201.          underline       =   0   'False
  202.          italic          =   0   'False
  203.          strikethrough   =   0   'False
  204.       EndProperty
  205.       Height          =   495
  206.       Left            =   180
  207.       TabIndex        =   4
  208.       Top             =   120
  209.       Width           =   8955
  210.    End
  211.    Begin SlideLib.ctSlide ctSlide_blue 
  212.       Height          =   4275
  213.       Left            =   1920
  214.       TabIndex        =   3
  215.       Top             =   1560
  216.       Width           =   735
  217.       _version        =   65536
  218.       _extentx        =   1296
  219.       _extenty        =   7541
  220.       _stockprops     =   68
  221.       innerborder     =   3
  222.       outerborder     =   2
  223.       sliderstyle     =   1
  224.       maxvalue        =   256
  225.       slideroffset    =   8
  226.       pictureback     =   "ct_slide.frx":136D
  227.       picturethumb    =   "ct_slide.frx":1389
  228.       innercolor      =   16711680
  229.       barcolor        =   16776960
  230.    End
  231.    Begin SlideLib.ctSlide ctSlide_green 
  232.       Height          =   4275
  233.       Left            =   1080
  234.       TabIndex        =   2
  235.       Top             =   1560
  236.       Width           =   735
  237.       _version        =   65536
  238.       _extentx        =   1296
  239.       _extenty        =   7541
  240.       _stockprops     =   68
  241.       innerborder     =   3
  242.       outerborder     =   2
  243.       sliderstyle     =   1
  244.       maxvalue        =   256
  245.       slideroffset    =   8
  246.       pictureback     =   "ct_slide.frx":13A5
  247.       picturethumb    =   "ct_slide.frx":13C1
  248.       innercolor      =   65280
  249.    End
  250.    Begin SlideLib.ctSlide ctSlide_red 
  251.       Height          =   4275
  252.       Left            =   240
  253.       TabIndex        =   1
  254.       Top             =   1560
  255.       Width           =   735
  256.       _version        =   65536
  257.       _extentx        =   1296
  258.       _extenty        =   7541
  259.       _stockprops     =   68
  260.       innerborder     =   3
  261.       outerborder     =   2
  262.       sliderstyle     =   1
  263.       maxvalue        =   256
  264.       slideroffset    =   8
  265.       pictureback     =   "ct_slide.frx":13DD
  266.       picturethumb    =   "ct_slide.frx":13F9
  267.       innercolor      =   255
  268.       barcolor        =   65535
  269.    End
  270.    Begin SlideLib.ctSlide ctSlide1 
  271.       Height          =   735
  272.       Left            =   240
  273.       TabIndex        =   0
  274.       Top             =   660
  275.       Width           =   8895
  276.       _version        =   65536
  277.       _extentx        =   15690
  278.       _extenty        =   1296
  279.       _stockprops     =   68
  280.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  281.          name            =   "Times New Roman"
  282.          charset         =   0
  283.          weight          =   700
  284.          size            =   8.25
  285.          underline       =   0   'False
  286.          italic          =   0   'False
  287.          strikethrough   =   0   'False
  288.       EndProperty
  289.       innerborder     =   3
  290.       thumbstyle      =   1
  291.       slidertype      =   1
  292.       maxvalue        =   144
  293.       innerbottom     =   20
  294.       innertop        =   6
  295.       showmax         =   12
  296.       thumbvert       =   20
  297.       forecolor       =   8388608
  298.       innercolor      =   14745599
  299.    End
  300. Attribute VB_Name = "w_slide_demo"
  301. Attribute VB_Creatable = False
  302. Attribute VB_Exposed = False
  303. Sub settime()
  304. Dim cHour As String
  305. Dim cMin As String
  306. Dim cTime As String
  307. Dim nHour  As Integer
  308. Dim nMin As Integer
  309. nHour = Int(ctSlide1.Value / 12)
  310. nMin = (ctSlide1.Value Mod 12) * 5
  311. If nHour = 0 Then
  312.    cHour = "12"
  313.    cHour = Str(nHour)
  314. End If
  315. cMin = Right$("00" + Trim$(Str$(nMin)), 2)
  316. If (ctSlide1.Value = 144 And Not rb_pm) Then
  317.    cTime = "P.M."
  318. ElseIf (ctSlide1.Value = 144 And rb_pm) Then
  319.    cTime = "A.M."
  320. ElseIf (rb_pm) Then
  321.    cTime = "P.M."
  322.    cTime = "A.M."
  323. End If
  324. lbl_time.Caption = (cHour + ":" + cMin + " " + cTime)
  325. End Sub
  326. Private Sub ctSlide1_SlideChange()
  327.    settime
  328. End Sub
  329. Private Sub Command1_Click()
  330.    Unload w_slide_demo
  331. End Sub
  332. Private Sub ctSlide_blue_SlideChange()
  333.    uo_color.BackColor = RGB(ctSlide_red, ctSlide_green, ctSlide_blue)
  334.    lbl_blue = Str(ctSlide_blue.Value)
  335. End Sub
  336. Private Sub ctSlide_green_SlideChange()
  337.    uo_color.BackColor = RGB(ctSlide_red, ctSlide_green, ctSlide_blue)
  338.    lbl_green = Str(ctSlide_green.Value)
  339. End Sub
  340. Private Sub ctSlide_red_SlideChange()
  341.    uo_color.BackColor = RGB(ctSlide_red, ctSlide_green, ctSlide_blue)
  342.    lbl_red = Str(ctSlide_red.Value)
  343. End Sub
  344. Private Sub Form_Load()
  345.    ' Center the window on the screen
  346.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * 0.1
  347. End Sub
  348. Private Sub rb_am_Click()
  349.    settime
  350. End Sub
  351. Private Sub rb_pm_Click()
  352.    settime
  353. End Sub
  354.