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

  1. VERSION 4.00
  2. Begin VB.Form w_clock_demo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "ctClock (Clock Control) Demo"
  6.    ClientHeight    =   5520
  7.    ClientLeft      =   1200
  8.    ClientTop       =   1335
  9.    ClientWidth     =   9165
  10.    Height          =   5925
  11.    Icon            =   "ct_clock.frx":0000
  12.    Left            =   1140
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   5520
  18.    ScaleWidth      =   9165
  19.    Top             =   990
  20.    Width           =   9285
  21.    Begin VB.Frame Frame1 
  22.       Caption         =   "Clock Type"
  23.       BeginProperty Font 
  24.          name            =   "MS Sans Serif"
  25.          charset         =   0
  26.          weight          =   700
  27.          size            =   8.25
  28.          underline       =   0   'False
  29.          italic          =   0   'False
  30.          strikethrough   =   0   'False
  31.       EndProperty
  32.       Height          =   1005
  33.       Left            =   360
  34.       TabIndex        =   11
  35.       Top             =   4050
  36.       Width           =   1635
  37.       Begin VB.OptionButton Option2 
  38.          Caption         =   "Analog"
  39.          Height          =   285
  40.          Left            =   180
  41.          TabIndex        =   13
  42.          Top             =   630
  43.          Width           =   1155
  44.       End
  45.       Begin VB.OptionButton Option1 
  46.          Caption         =   "Digital"
  47.          Height          =   285
  48.          Left            =   180
  49.          TabIndex        =   12
  50.          Top             =   270
  51.          Value           =   -1  'True
  52.          Width           =   1155
  53.       End
  54.    End
  55.    Begin VB.CheckBox Check3 
  56.       Caption         =   "Include AM/PM"
  57.       Height          =   285
  58.       Left            =   3240
  59.       TabIndex        =   10
  60.       Top             =   3510
  61.       Value           =   1  'Checked
  62.       Width           =   1755
  63.    End
  64.    Begin VB.CheckBox Check2 
  65.       Caption         =   "Include Seconds"
  66.       Height          =   285
  67.       Left            =   3240
  68.       TabIndex        =   9
  69.       Top             =   3150
  70.       Value           =   1  'Checked
  71.       Width           =   1695
  72.    End
  73.    Begin VB.CheckBox Check1 
  74.       Caption         =   "Military Time"
  75.       Height          =   285
  76.       Left            =   3240
  77.       TabIndex        =   8
  78.       Top             =   2790
  79.       Width           =   1275
  80.    End
  81.    Begin VB.CommandButton Command2 
  82.       Caption         =   "Set Alarm"
  83.       Height          =   375
  84.       Left            =   3240
  85.       TabIndex        =   7
  86.       Top             =   1710
  87.       Width           =   1695
  88.    End
  89.    Begin VB.CommandButton Command1 
  90.       Caption         =   "E&xit"
  91.       Height          =   465
  92.       Left            =   3600
  93.       TabIndex        =   1
  94.       Top             =   4770
  95.       Width           =   1095
  96.    End
  97.    Begin VB.Label Label3 
  98.       Alignment       =   2  'Center
  99.       Caption         =   "Set the alarm for three seconds from now."
  100.       Height          =   465
  101.       Left            =   3300
  102.       TabIndex        =   6
  103.       Top             =   1170
  104.       Width           =   1575
  105.    End
  106.    Begin VB.Label lbl_time 
  107.       Alignment       =   2  'Center
  108.       BackColor       =   &H00FFFFFF&
  109.       BorderStyle     =   1  'Fixed Single
  110.       Caption         =   "1:50"
  111.       BeginProperty Font 
  112.          name            =   "MS Sans Serif"
  113.          charset         =   0
  114.          weight          =   400
  115.          size            =   12
  116.          underline       =   0   'False
  117.          italic          =   0   'False
  118.          strikethrough   =   0   'False
  119.       EndProperty
  120.       Height          =   375
  121.       Left            =   6480
  122.       TabIndex        =   5
  123.       Top             =   3960
  124.       Width           =   1155
  125.    End
  126.    Begin VB.Label Label2 
  127.       Alignment       =   2  'Center
  128.       Caption         =   $"ct_clock.frx":030A
  129.       ForeColor       =   &H00800000&
  130.       Height          =   825
  131.       Left            =   4980
  132.       TabIndex        =   4
  133.       Top             =   4500
  134.       Width           =   3975
  135.    End
  136.    Begin ClockLib.ctClock ctClock2 
  137.       Height          =   2895
  138.       Left            =   5460
  139.       TabIndex        =   3
  140.       Top             =   900
  141.       Width           =   3135
  142.       _version        =   65536
  143.       _extentx        =   5530
  144.       _extenty        =   5106
  145.       _stockprops     =   68
  146.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  147.          name            =   "Times New Roman"
  148.          charset         =   0
  149.          weight          =   700
  150.          size            =   14.25
  151.          underline       =   0   'False
  152.          italic          =   0   'False
  153.          strikethrough   =   0   'False
  154.       EndProperty
  155.       backcolor       =   12632256
  156.       forecolor       =   128
  157.       hourcolor       =   8388608
  158.       minutecolor     =   16711680
  159.       clocktype       =   1
  160.       bordertype      =   1
  161.       timetype        =   1
  162.       numberoffset    =   10
  163.       currenthour     =   1
  164.       currentminute   =   50
  165.       includeseconds  =   0   'False
  166.    End
  167.    Begin VB.Label Label1 
  168.       Alignment       =   2  'Center
  169.       Caption         =   $"ct_clock.frx":03E5
  170.       BeginProperty Font 
  171.          name            =   "MS Sans Serif"
  172.          charset         =   0
  173.          weight          =   700
  174.          size            =   8.25
  175.          underline       =   0   'False
  176.          italic          =   0   'False
  177.          strikethrough   =   0   'False
  178.       EndProperty
  179.       ForeColor       =   &H00800000&
  180.       Height          =   645
  181.       Left            =   180
  182.       TabIndex        =   2
  183.       Top             =   90
  184.       Width           =   8715
  185.    End
  186.    Begin ClockLib.ctClock ctClock1 
  187.       Height          =   2715
  188.       Left            =   300
  189.       TabIndex        =   0
  190.       Top             =   1080
  191.       Width           =   2775
  192.       _version        =   65536
  193.       _extentx        =   4895
  194.       _extenty        =   4789
  195.       _stockprops     =   68
  196.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  197.          name            =   "Arial"
  198.          charset         =   0
  199.          weight          =   400
  200.          size            =   18
  201.          underline       =   0   'False
  202.          italic          =   0   'False
  203.          strikethrough   =   0   'False
  204.       EndProperty
  205.       backcolor       =   12648447
  206.       secondcolor     =   255
  207.       bordertype      =   3
  208.       numberoffset    =   7
  209.       currenthour     =   18
  210.       currentminute   =   16
  211.       currentsecond   =   4
  212.    End
  213. Attribute VB_Name = "w_clock_demo"
  214. Attribute VB_Creatable = False
  215. Attribute VB_Exposed = False
  216. Private Sub Check1_Click()
  217.    ctClock1.MilitaryTime = Check1.Value
  218. End Sub
  219. Private Sub Check2_Click()
  220.    ctClock1.IncludeSeconds = Check2.Value
  221. End Sub
  222. Private Sub Check3_Click()
  223.    ctClock1.IncludeAmPm = Check3.Value
  224. End Sub
  225. Private Sub Command1_Click()
  226.    Unload w_clock_demo
  227. End Sub
  228. Private Sub Command2_Click()
  229.    ctClock1.AlarmHour = ctClock1.CurrentHour
  230.    ctClock1.AlarmMinute = ctClock1.CurrentMinute
  231.    ctClock1.AlarmSecond = ctClock1.CurrentSecond + 3
  232.    If (ctClock1.CurrentSecond + 3 >= 60) Then
  233.       ctClock1.AlarmMinute = ctClock1.CurrentMinute + 1
  234.    End If
  235. End Sub
  236. Private Sub ctClock2_TimeChange(nHour As Integer, nMinute As Integer, nSecond As Integer)
  237.    Dim cTime As String
  238.    If nHour = 0 Then
  239.       cTime = "12" + ":"
  240.    Else
  241.       cTime = Str(nHour) + ":"
  242.    End If
  243.    If (nMinute < 10) Then
  244.       cTime = cTime + "0"
  245.    End If
  246.    lbl_time.Caption = cTime + LTrim(Str(nMinute))
  247. End Sub
  248. Private Sub Form_Load()
  249.    ' Center the window on the screen
  250.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * 0.15
  251. End Sub
  252. Private Sub Option1_Click()
  253.    ctClock1.ClockType = 0
  254.    ctClock1.FontSize = 18
  255. End Sub
  256. Private Sub Option2_Click()
  257.    ctClock1.ClockType = 1
  258.    ctClock1.FontSize = 8
  259. End Sub
  260.