home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhclck / mhclock.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-11-27  |  27.2 KB  |  798 lines

  1. VERSION 4.00
  2. Begin VB.Form MhClock 
  3.    Caption         =   "MhClock"
  4.    ClientHeight    =   4308
  5.    ClientLeft      =   1740
  6.    ClientTop       =   2472
  7.    ClientWidth     =   9276
  8.    Height          =   4692
  9.    Left            =   1692
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4308
  12.    ScaleWidth      =   9276
  13.    Top             =   2136
  14.    Width           =   9372
  15.    Begin VB.CommandButton Command2 
  16.       Caption         =   "E&xit"
  17.       Height          =   375
  18.       Left            =   7680
  19.       TabIndex        =   30
  20.       Top             =   3720
  21.       Width           =   1215
  22.    End
  23.    Begin VB.Frame Frame1 
  24.       Caption         =   "Analog"
  25.       Height          =   4095
  26.       Left            =   120
  27.       TabIndex        =   0
  28.       Top             =   120
  29.       Width           =   4455
  30.       Begin VB.Frame Frame3 
  31.          Caption         =   "Style"
  32.          Height          =   2055
  33.          Left            =   2280
  34.          TabIndex        =   2
  35.          Top             =   240
  36.          Width           =   2055
  37.          Begin VB.CheckBox SepSeconds 
  38.             Caption         =   "Seperate Seconds"
  39.             Height          =   255
  40.             Left            =   240
  41.             TabIndex        =   7
  42.             Top             =   1680
  43.             Width           =   1695
  44.          End
  45.          Begin VB.OptionButton aStyle4 
  46.             Caption         =   "24 hour with seconds"
  47.             Height          =   255
  48.             Left            =   120
  49.             TabIndex        =   6
  50.             Top             =   1320
  51.             Width           =   1815
  52.          End
  53.          Begin VB.OptionButton aStyle3 
  54.             Caption         =   "24 hour"
  55.             Height          =   255
  56.             Left            =   120
  57.             TabIndex        =   5
  58.             Top             =   960
  59.             Width           =   1815
  60.          End
  61.          Begin VB.OptionButton aStyle2 
  62.             Caption         =   "12 hour with seconds"
  63.             Height          =   255
  64.             Left            =   120
  65.             TabIndex        =   4
  66.             Top             =   600
  67.             Width           =   1815
  68.          End
  69.          Begin VB.OptionButton aStyle1 
  70.             Caption         =   "12 hour"
  71.             Height          =   255
  72.             Left            =   120
  73.             TabIndex        =   3
  74.             Top             =   240
  75.             Width           =   1815
  76.          End
  77.       End
  78.       Begin VB.Frame Frame4 
  79.          Caption         =   "Settings"
  80.          Height          =   1695
  81.          Left            =   120
  82.          TabIndex        =   8
  83.          Top             =   2280
  84.          Width           =   4215
  85.          Begin VB.PictureBox Picture2 
  86.             ClipControls    =   0   'False
  87.             Height          =   495
  88.             Left            =   360
  89.             Negotiate       =   -1  'True
  90.             ScaleHeight     =   156.757
  91.             ScaleMode       =   0  'User
  92.             ScaleWidth      =   1031.746
  93.             TabIndex        =   29
  94.             Top             =   960
  95.             Width           =   1230
  96.          End
  97.          Begin VB.OptionButton PMOption1 
  98.             Caption         =   "PM"
  99.             Enabled         =   0   'False
  100.             Height          =   195
  101.             Left            =   1320
  102.             TabIndex        =   16
  103.             Top             =   600
  104.             Width           =   615
  105.          End
  106.          Begin VB.OptionButton AMOption1 
  107.             Caption         =   "AM"
  108.             Enabled         =   0   'False
  109.             Height          =   195
  110.             Left            =   1320
  111.             TabIndex        =   15
  112.             Top             =   360
  113.             Width           =   615
  114.          End
  115.          Begin VB.CheckBox Check1 
  116.             Caption         =   "Alarm"
  117.             Height          =   195
  118.             Left            =   120
  119.             TabIndex        =   11
  120.             Top             =   240
  121.             Width           =   855
  122.          End
  123.          Begin VB.ComboBox Combo2 
  124.             Height          =   315
  125.             Left            =   2160
  126.             Style           =   2  'Dropdown List
  127.             TabIndex        =   10
  128.             Top             =   1200
  129.             Width           =   1935
  130.          End
  131.          Begin VB.ComboBox Combo1 
  132.             Height          =   315
  133.             ItemData        =   "MhClock.frx":0000
  134.             Left            =   2160
  135.             List            =   "MhClock.frx":0002
  136.             Style           =   2  'Dropdown List
  137.             TabIndex        =   9
  138.             Top             =   480
  139.             Width           =   1935
  140.          End
  141.          Begin MhintimeLib.MhTimeInput MhTimeInput1 
  142.             Height          =   315
  143.             Left            =   120
  144.             TabIndex        =   14
  145.             Top             =   480
  146.             Width           =   1095
  147.             _Version        =   65536
  148.             _ExtentX        =   1931
  149.             _ExtentY        =   556
  150.             _StockProps     =   77
  151.             BackColor       =   16777215
  152.             Enabled         =   0   'False
  153.             TintColor       =   16711935
  154.             Alignment       =   0
  155.             BevelSize       =   2
  156.             BevelStyle      =   0
  157.             BorderColor     =   -2147483642
  158.             BorderStyle     =   0
  159.             FillColor       =   16777215
  160.             LightColor      =   16777215
  161.             ShadowColor     =   8421504
  162.             TextColor       =   -2147483640
  163.             Text            =   ""
  164.             ReadOnly        =   0   'False
  165.             Spin            =   2
  166.             SpinDelay       =   500
  167.             SpinSpeed       =   500
  168.             Indent          =   0
  169.             AutoHScroll     =   0   'False
  170.             FontStyle       =   0
  171.             Verbose         =   0   'False
  172.             CaretHeight     =   10
  173.             CaretWidth      =   0
  174.             CaretColor      =   -2147483640
  175.             CaretStyle      =   1
  176.             CaretVAlign     =   1
  177.             CaretInterval   =   400
  178.             CaretVisible    =   -1  'True
  179.             Separator       =   58
  180.             TimeFormat      =   1
  181.             Country         =   0
  182.             VAlignment      =   2
  183.             MaxHours        =   11
  184.             MaxMinutes      =   59
  185.             MaxSeconds      =   59
  186.             MinHours        =   1
  187.             MinMinutes      =   0
  188.             MinSeconds      =   0
  189.             SpinChange      =   1
  190.             AllowBlank      =   0   'False
  191.             FocusSelect     =   0   'False
  192.             AM              =   0   'False
  193.          End
  194.          Begin VB.Label Label3 
  195.             AutoSize        =   -1  'True
  196.             Caption         =   "Font Style"
  197.             Height          =   195
  198.             Left            =   2160
  199.             TabIndex        =   13
  200.             Top             =   960
  201.             Width           =   705
  202.          End
  203.          Begin VB.Label Label2 
  204.             AutoSize        =   -1  'True
  205.             Caption         =   "Picture"
  206.             Height          =   195
  207.             Left            =   2160
  208.             TabIndex        =   12
  209.             Top             =   240
  210.             Width           =   495
  211.          End
  212.       End
  213.       Begin Mhcl200Lib.MhClock MhClock1 
  214.          Height          =   2055
  215.          Left            =   120
  216.          TabIndex        =   31
  217.          Top             =   240
  218.          Width           =   2055
  219.          _Version        =   65536
  220.          _ExtentX        =   3625
  221.          _ExtentY        =   3625
  222.          _StockProps     =   77
  223.          TintColor       =   16711935
  224.          Style           =   5
  225.          PictureAClock   =   "MhClock.frx":0004
  226.          PictureDClock   =   "MhClock.frx":0020
  227.          Hour            =   -1
  228.          Minute          =   -1
  229.          Second          =   -1
  230.          HourHandLen     =   50
  231.          HourHandWidth   =   4
  232.          MinuteHandLen   =   80
  233.          MinuteHandWidth =   2
  234.          SecondHandLen   =   90
  235.          SecondHandWidth =   1
  236.          ScaleMode       =   3
  237.          AlarmHour       =   -1
  238.          AlarmMinute     =   -1
  239.          AlarmSecond     =   -1
  240.          DiffHour        =   -1
  241.          DiffMinute      =   -1
  242.          DiffSecond      =   -1
  243.          Interval        =   1000
  244.          TextColor       =   -2147483630
  245.          LightColor      =   -2147483628
  246.          ShadowColor     =   -2147483632
  247.          FillColor       =   -2147483633
  248.          BorderColor     =   -2147483642
  249.          HourTop         =   0
  250.          HourLeft        =   0
  251.          HourWidth       =   172
  252.          HourHeight      =   172
  253.          MinuteTop       =   0
  254.          MinuteLeft      =   0
  255.          MinuteWidth     =   172
  256.          MinuteHeight    =   172
  257.          SecondTop       =   0
  258.          SecondLeft      =   0
  259.          SecondWidth     =   172
  260.          SecondHeight    =   172
  261.          BestFit         =   -1  'True
  262.       End
  263.    End
  264.    Begin VB.Frame Frame2 
  265.       Caption         =   "Digital"
  266.       Height          =   3135
  267.       Left            =   4800
  268.       TabIndex        =   1
  269.       Top             =   120
  270.       Width           =   4335
  271.       Begin VB.PictureBox Picture1 
  272.          BackColor       =   &H00C0C0C0&
  273.          FillColor       =   &H000000FF&
  274.          FillStyle       =   0  'Solid
  275.          Height          =   195
  276.          Left            =   2475
  277.          ScaleHeight     =   144
  278.          ScaleWidth      =   204
  279.          TabIndex        =   18
  280.          Top             =   870
  281.          Width           =   255
  282.       End
  283.       Begin VB.Frame Frame5 
  284.          Caption         =   "Settings"
  285.          Height          =   1665
  286.          Left            =   120
  287.          TabIndex        =   19
  288.          Top             =   1260
  289.          Width           =   4110
  290.          Begin VB.ComboBox Combo4 
  291.             Height          =   315
  292.             Left            =   2040
  293.             TabIndex        =   28
  294.             Text            =   "Combo4"
  295.             Top             =   1200
  296.             Width           =   1935
  297.          End
  298.          Begin VB.CommandButton Command1 
  299.             Caption         =   "&Font"
  300.             Height          =   375
  301.             Left            =   240
  302.             TabIndex        =   26
  303.             Top             =   1080
  304.             Width           =   1215
  305.          End
  306.          Begin VB.ComboBox Combo3 
  307.             Height          =   315
  308.             Left            =   2040
  309.             TabIndex        =   25
  310.             Text            =   "Combo3"
  311.             Top             =   450
  312.             Width           =   1935
  313.          End
  314.          Begin VB.OptionButton PMOption2 
  315.             Caption         =   "PM"
  316.             Enabled         =   0   'False
  317.             Height          =   195
  318.             Left            =   1320
  319.             TabIndex        =   23
  320.             Top             =   600
  321.             Width           =   615
  322.          End
  323.          Begin VB.OptionButton AMOption2 
  324.             Caption         =   "AM"
  325.             Enabled         =   0   'False
  326.             Height          =   195
  327.             Left            =   1320
  328.             TabIndex        =   22
  329.             Top             =   360
  330.             Width           =   615
  331.          End
  332.          Begin VB.CheckBox Check2 
  333.             Caption         =   "Alarm"
  334.             Height          =   195
  335.             Left            =   120
  336.             TabIndex        =   20
  337.             Top             =   240
  338.             Width           =   735
  339.          End
  340.          Begin VB.Label Label4 
  341.             AutoSize        =   -1  'True
  342.             Caption         =   "Font Style"
  343.             Height          =   195
  344.             Left            =   2040
  345.             TabIndex        =   27
  346.             Top             =   960
  347.             Width           =   705
  348.          End
  349.          Begin VB.Label Label1 
  350.             AutoSize        =   -1  'True
  351.             Caption         =   "Picture"
  352.             Height          =   195
  353.             Left            =   2040
  354.             TabIndex        =   24
  355.             Top             =   225
  356.             Width           =   495
  357.          End
  358.          Begin MhintimeLib.MhTimeInput MhTimeInput2 
  359.             Height          =   315
  360.             Left            =   120
  361.             TabIndex        =   21
  362.             Top             =   480
  363.             Width           =   1095
  364.             _Version        =   65536
  365.             _ExtentX        =   1931
  366.             _ExtentY        =   556
  367.             _StockProps     =   77
  368.             Enabled         =   0   'False
  369.             TintColor       =   16711935
  370.             Alignment       =   0
  371.             BevelSize       =   2
  372.             BevelStyle      =   0
  373.             BorderColor     =   -2147483642
  374.             BorderStyle     =   0
  375.             FillColor       =   16777215
  376.             LightColor      =   -2147483643
  377.             ShadowColor     =   -2147483632
  378.             TextColor       =   -2147483640
  379.             Text            =   ""
  380.             ReadOnly        =   0   'False
  381.             Spin            =   2
  382.             SpinDelay       =   500
  383.             SpinSpeed       =   500
  384.             Indent          =   0
  385.             AutoHScroll     =   0   'False
  386.             FontStyle       =   0
  387.             Verbose         =   0   'False
  388.             CaretHeight     =   10
  389.             CaretWidth      =   0
  390.             CaretColor      =   -2147483640
  391.             CaretStyle      =   1
  392.             CaretVAlign     =   1
  393.             CaretInterval   =   400
  394.             CaretVisible    =   -1  'True
  395.             Separator       =   58
  396.             TimeFormat      =   1
  397.             Country         =   0
  398.             VAlignment      =   2
  399.             MaxHours        =   11
  400.             MaxMinutes      =   59
  401.             MaxSeconds      =   59
  402.             MinHours        =   0
  403.             MinMinutes      =   0
  404.             MinSeconds      =   0
  405.             SpinChange      =   1
  406.             AllowBlank      =   0   'False
  407.             FocusSelect     =   0   'False
  408.             AM              =   0   'False
  409.          End
  410.       End
  411.       Begin VB.Shape Shape1 
  412.          BorderStyle     =   0  'Transparent
  413.          Height          =   195
  414.          Left            =   2340
  415.          Top             =   885
  416.          Width           =   225
  417.       End
  418.       Begin Mhcl200Lib.MhClock MhClock2 
  419.          Height          =   915
  420.          Left            =   600
  421.          TabIndex        =   17
  422.          Top             =   300
  423.          Width           =   3135
  424.          _Version        =   65536
  425.          _ExtentX        =   5530
  426.          _ExtentY        =   1614
  427.          _StockProps     =   77
  428.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  429.             name            =   "MS Sans Serif"
  430.             charset         =   0
  431.             weight          =   700
  432.             size            =   12
  433.             underline       =   0   'False
  434.             italic          =   0   'False
  435.             strikethrough   =   0   'False
  436.          EndProperty
  437.          TintColor       =   16711935
  438.          Style           =   1
  439.          PictureAClock   =   "MhClock.frx":003C
  440.          PictureDClock   =   "MhClock.frx":0058
  441.          Hour            =   9
  442.          Minute          =   35
  443.          Second          =   30
  444.          HourHandLen     =   50
  445.          HourHandWidth   =   4
  446.          MinuteHandLen   =   90
  447.          MinuteHandWidth =   2
  448.          SecondHandLen   =   100
  449.          SecondHandWidth =   1
  450.          ScaleMode       =   1
  451.          AlarmHour       =   -1
  452.          AlarmMinute     =   -1
  453.          AlarmSecond     =   -1
  454.          DiffHour        =   9
  455.          DiffMinute      =   35
  456.          DiffSecond      =   30
  457.          Interval        =   1000
  458.          TextColor       =   16777215
  459.          LightColor      =   16777215
  460.          ShadowColor     =   8421504
  461.          FillColor       =   12632256
  462.          BorderColor     =   -2147483642
  463.          HourTop         =   195
  464.          HourLeft        =   150
  465.          HourWidth       =   451
  466.          HourHeight      =   571
  467.          MinuteTop       =   195
  468.          MinuteLeft      =   705
  469.          MinuteWidth     =   451
  470.          MinuteHeight    =   571
  471.          SecondTop       =   195
  472.          SecondLeft      =   1245
  473.          SecondWidth     =   571
  474.          SecondHeight    =   541
  475.          MousePointer    =   87
  476.          MouseIcon       =   "MhClock.frx":30EA
  477.       End
  478.    End
  479.    Begin MSComDlg.CommonDialog FontDlg 
  480.       Left            =   4920
  481.       Top             =   3480
  482.       _version        =   65536
  483.       _extentx        =   677
  484.       _extenty        =   677
  485.       _stockprops     =   0
  486.       flags           =   103
  487.    End
  488. Attribute VB_Name = "MhClock"
  489. Attribute VB_Creatable = False
  490. Attribute VB_Exposed = False
  491. Dim Alarm1, Flash1 As Boolean   'Used for Analog Clock
  492. Dim Alarm2, Flash2 As Boolean   'Used for Digital Clock
  493. Private Sub aStyle1_Click()
  494.     'Set Style of Analog Clock to 12 Hour no Second
  495.     'Hand and force Seperate Seconds to FALSE
  496.     MhClock1.Style = 4
  497.     SepSeconds.Value = False
  498. End Sub
  499. Private Sub aStyle2_Click()
  500.     'Set Style of Analog Clock to 12 Hour with Seconds
  501.     'Hand and check to see if the Seperate Seconds box
  502.     'is check and set Clock face if it is.
  503.     MhClock1.Style = 5
  504.     If SepSeconds.Value Then
  505.         Combo1.ListIndex = 2
  506.         MhClock1.SecondTop = 65
  507.         MhClock1.SecondBottom = 39
  508.         MhClock1.SecondLeft = 29
  509.         MhClock1.SecondRight = 77
  510.         MhClock1.PictureAClock = LoadPicture(App.Path & "\sClock12.bmp")
  511.         MhClock1.TextColor = &HFFFF00
  512.     End If
  513. End Sub
  514. Private Sub aStyle3_Click()
  515.     'Set Style of Analog Clock to 24 Hour no Seconds
  516.     'Hand and force Seperate Seconds to FALSE
  517.     MhClock1.Style = 6
  518.     MhClock1.PictureAClock = LoadPicture("")
  519.     SepSeconds.Value = False
  520.     Combo1.ListIndex = 0
  521. End Sub
  522. Private Sub aStyle4_Click()
  523.     'Set Style of Analog Clock to 24 Hour with Seconds
  524.     'Hand and force Seperate Seconds to FALSE
  525.     MhClock1.Style = 7
  526.     MhClock1.PictureAClock = LoadPicture("")
  527.     SepSeconds.Value = False
  528.     Combo1.ListIndex = 0
  529. End Sub
  530. Private Sub Check1_Click()
  531. Dim cNow
  532.     'Toggle .Enabled property of Alarm controls
  533.     MhTimeInput1.Enabled = Not MhTimeInput1.Enabled
  534.     AMOption1.Enabled = Not AMOption1.Enabled
  535.     PMOption1.Enabled = Not PMOption1.Enabled
  536.     Alarm1 = Not Alarm1
  537.     'If Alarm is Checked
  538.     If Alarm1 Then
  539.         'Default Alarm time to 10 seconds from now
  540.         cNow = Format(Now, "hh:mm:ss AMPM")
  541.         
  542.         If Int(Mid(cNow, 7, 2)) >= 50 Then
  543.             MhTimeInput1.Text = Left(cNow, 3) + IIf(Len(Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) = 1, "0" + Trim(Str(Int(Mid(cNow, 4, 2) + 1))), Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) + ":10"
  544.         Else
  545.             MhTimeInput1.Text = Left(cNow, 6) + Trim(Str(Int(Mid(cNow, 7, 2) + 10)))
  546.         End If
  547.         
  548.         If Right(cNow, 2) = "PM" Then
  549.             PMOption1.Value = True
  550.         Else
  551.             AMOption1.Value = True
  552.         End If
  553.         
  554.         'Check to see if it's 'AM' or 'PM'
  555.         If PMOption1.Value Then
  556.             MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2)) + 12
  557.         Else
  558.             MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2))
  559.         End If
  560.         MhClock1.AlarmMinute = Int(Mid(MhTimeInput1.Text, 4, 2))
  561.         MhClock1.AlarmSecond = Int(Mid(MhTimeInput1.Text, 7, 2))
  562.     Else
  563.         'Turn off and disable Alarm
  564.         Flash1 = False
  565.         Picture2.BackColor = &H8000000F
  566.         MhClock1.AlarmHour = -1
  567.         MhClock1.AlarmMinute = -1
  568.         MhClock1.AlarmSecond = -1
  569.     End If
  570. End Sub
  571. Private Sub Check2_Click()
  572. Dim cNow
  573.     'Toggle .Enabled property of Alarm controls
  574.     MhTimeInput2.Enabled = Not MhTimeInput2.Enabled
  575.     AMOption2.Enabled = Not AMOption2.Enabled
  576.     PMOption2.Enabled = Not PMOption2.Enabled
  577.     Alarm2 = Not Alarm2
  578.     'If Alarm is Checked
  579.     If Alarm2 Then
  580.         'Default Alarm time to 10 seconds from now
  581.         cNow = Format(Now, "hh:mm:ss AMPM")
  582.         
  583.         If Int(Mid(cNow, 7, 2)) >= 50 Then
  584.             MhTimeInput2.Text = Left(cNow, 3) + IIf(Len(Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) = 1, "0" + Trim(Str(Int(Mid(cNow, 4, 2) + 1))), Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) + ":10"
  585.         Else
  586.             MhTimeInput2.Text = Left(cNow, 6) + Trim(Str(Int(Mid(cNow, 7, 2) + 10)))
  587.         End If
  588.         
  589.         If Right(cNow, 2) = "PM" Then
  590.             PMOption2.Value = True
  591.         Else
  592.             AMOption2.Value = True
  593.         End If
  594.         
  595.         'Check to see if it's 'AM' or 'PM'
  596.         If PMOption2.Value Then
  597.             MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2)) + 12
  598.         Else
  599.             MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2))
  600.         End If
  601.         MhClock2.AlarmMinute = Int(Mid(MhTimeInput2.Text, 4, 2))
  602.         MhClock2.AlarmSecond = Int(Mid(MhTimeInput2.Text, 7, 2))
  603.     Else
  604.         'Turn off and disable Alarm
  605.         Flash2 = False
  606.         Picture1.BackColor = &H8000000F
  607.         MhClock2.AlarmHour = -1
  608.         MhClock2.AlarmMinute = -1
  609.         MhClock2.AlarmSecond = -1
  610.     End If
  611. End Sub
  612. Private Sub Combo1_Click()
  613.     'Set MhClock1.Picture property correctl and set
  614.     'Second Hand Height, Width, Position correctly.
  615.     Select Case Combo1.ListIndex
  616.         
  617.         Case Is = 0
  618.             SepSeconds.Value = False
  619.             MhClock1.SecondTop = 0
  620.             MhClock1.SecondBottom = 0
  621.             MhClock1.SecondLeft = 0
  622.             MhClock1.SecondRight = 0
  623.             MhClock1.PictureAClock = LoadPicture("")
  624.             MhClock1.TextColor = &H0
  625.             
  626.         Case Is = 1
  627.             SepSeconds.Value = False
  628.             MhClock1.SecondTop = 0
  629.             MhClock1.SecondBottom = 0
  630.             MhClock1.SecondLeft = 0
  631.             MhClock1.SecondRight = 0
  632.             MhClock1.PictureAClock = LoadPicture(App.Path & "\aClock12.bmp")
  633.             MhClock1.TextColor = &HFFFF00
  634.             
  635.         Case Is = 2
  636.             If Not SepSeconds.Value Then SepSeconds.Value = 1
  637.             MhClock1.SecondTop = 65
  638.             MhClock1.SecondBottom = 39
  639.             MhClock1.SecondLeft = 29
  640.             MhClock1.SecondRight = 77
  641.             MhClock1.PictureAClock = LoadPicture(App.Path & "\sClock12.bmp")
  642.             MhClock1.TextColor = &HFFFF00
  643.             
  644.     End Select
  645. End Sub
  646. Private Sub Combo2_Click()
  647.             
  648.     'Set the .FontStyle for clock
  649.     MhClock1.FontStyle = Combo2.ListIndex
  650.         
  651. End Sub
  652. Private Sub Combo3_Click()
  653.     'What picture do I want to see?
  654.     Select Case Combo3.ListIndex
  655.         
  656.         Case Is = 0
  657.             Picture1.Visible = False
  658.             MhClock2.PictureDClock = LoadPicture("")
  659.             MhClock2.TextColor = &H0
  660.             
  661.         Case Is = 1
  662.             MhClock2.PictureDClock = LoadPicture(App.Path & "\digital.bmp")
  663.             Picture1.Visible = True
  664.             MhClock2.TextColor = &HFFFFFF
  665.             
  666.     End Select
  667. End Sub
  668. Private Sub Combo4_Click()
  669.     'Set the .FontStyle for the clock
  670.     MhClock2.FontStyle = Combo4.ListIndex
  671. End Sub
  672. Private Sub Command1_Click()
  673.     'Bring up the standard Windows Font Dialog
  674.     FontDlg.FontName = MhClock2.FontName
  675.     FontDlg.FontSize = MhClock2.FontSize
  676.     FontDlg.ShowFont
  677.     MhClock2.FontName = FontDlg.FontName
  678.     MhClock2.FontUnderline = FontDlg.FontUnderline
  679.     MhClock2.FontStrikethru = FontDlg.FontStrikethru
  680.     MhClock2.FontBold = FontDlg.FontBold
  681.     MhClock2.FontItalic = FontDlg.FontItalic
  682.     MhClock2.FontSize = FontDlg.FontSize
  683. End Sub
  684. Private Sub Command2_Click()
  685.     'See 'ya
  686.     End
  687. End Sub
  688. Private Sub Form_Load()
  689.     'Set all default values for the two clocks
  690.     ChDir App.Path
  691.     Combo1.AddItem "None"
  692.     Combo1.AddItem "12 Hour Clock Face"
  693.     Combo1.AddItem "12 Hour Clock sep. Secs."
  694.     Combo1.ListIndex = 0
  695.     Combo2.AddItem "Normal"
  696.     Combo2.AddItem "Raised"
  697.     Combo2.AddItem "Raised more Shading"
  698.     Combo2.AddItem "Lowered"
  699.     Combo2.AddItem "Lowered more Shading"
  700.     Combo2.ListIndex = 0
  701.         
  702.     Combo3.AddItem "None"
  703.     Combo3.AddItem "Clock Radio"
  704.     Combo3.ListIndex = 1
  705.     Combo4.AddItem "Normal"
  706.     Combo4.AddItem "Raised"
  707.     Combo4.AddItem "Raised more Shading"
  708.     Combo4.AddItem "Lowered"
  709.     Combo4.AddItem "Lowered more Shading"
  710.     Combo4.ListIndex = 0
  711.     MhClock1.Hour = -1
  712.     MhClock1.Minute = -1
  713.     MhClock1.Second = -1
  714.     MhClock2.Hour = -1
  715.     MhClock2.Minute = -1
  716.     MhClock2.Second = -1
  717.     AMOption1.Value = True
  718.     AMOption2.Value = True
  719.     aStyle2.Value = True
  720.     MhClock1.Style = 5
  721.     MhClock2.Style = 1
  722.     Picture1.ZOrder (0)
  723. End Sub
  724. Private Sub MhClock1_Alarm()
  725.     'Alarming, isn't it?
  726.     Flash1 = True
  727. End Sub
  728. Private Sub MhClock1_ChangeSecond()
  729.     'Let'em see something if Alarm is going off
  730.     DoEvents
  731.     If Flash1 And Picture2.BackColor <> &HFF& Then
  732.         Picture2.BackColor = &HFF&
  733.     ElseIf Flash1 And Picture2.BackColor = &HFF& Then
  734.         Picture2.BackColor = &H8000000F
  735.     End If
  736. End Sub
  737. Private Sub MhClock2_Alarm()
  738.     'Alarming, isn't it
  739.     Flash2 = True
  740. End Sub
  741. Private Sub MhClock2_ChangeSecond()
  742.     'Let'em see something again
  743.     DoEvents
  744.     If Flash2 And Picture1.BackColor <> &HFF& Then
  745.         Picture1.BackColor = &HFF&
  746.     ElseIf Flash2 And Picture1.BackColor = &HFF& Then
  747.         Picture1.BackColor = &H8000000F
  748.     End If
  749. End Sub
  750. Private Sub MhTimeInput1_Change()
  751.         
  752.     'Set Alarm as the time value changes
  753.     If PMOption1Value Then
  754.         MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2)) + 12
  755.     Else
  756.         MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2))
  757.     End If
  758.     MhClock1.AlarmMinute = Int(Mid(MhTimeInput1.Text, 4, 2))
  759.     MhClock1.AlarmSecond = Int(Mid(MhTimeInput1.Text, 7, 2))
  760. End Sub
  761. Private Sub MhTimeInput2_Change()
  762.     'Set Alarm as the time value changes
  763.     If PMOption2.Value Then
  764.         MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2)) + 12
  765.     Else
  766.         MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2))
  767.     End If
  768.     MhClock2.AlarmMinute = Int(Mid(MhTimeInput2.Text, 4, 2))
  769.     MhClock2.AlarmSecond = Int(Mid(MhTimeInput2.Text, 7, 2))
  770. End Sub
  771. Private Sub Picture1_Click()
  772.     'Turn off Alarm
  773.     MhClock2.AlarmHour = -1
  774.     MhClock2.AlarmMinute = -1
  775.     MhClock2.AlarmSecond = -1
  776.     Picture1.BackColor = &H8000000F
  777.     Flash2 = False
  778.         
  779. End Sub
  780. Private Sub Picture2_Click()
  781.     'Turn off Alarm
  782.     MhClock1.AlarmHour = -1
  783.     MhClock1.AlarmMinute = -1
  784.     MhClock1.AlarmSecond = -1
  785.     Picture2.BackColor = &H8000000F
  786.     Flash1 = False
  787. End Sub
  788. Private Sub SepSeconds_Click()
  789.     'Do you want to have a seperate second dial?
  790.     If SepSeconds.Value Then
  791.         aStyle2.Value = True
  792.         Combo1.ListIndex = 2
  793.     Else
  794.         aStyle1.Value = True
  795.         Combo1.ListIndex = 1
  796.     End If
  797. End Sub
  798.