home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Programmer'…arterly (Limited Edition)
/
Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso
/
sharewar
/
midat5
/
mivb.frm
< prev
next >
Wrap
Text File
|
1994-12-31
|
20KB
|
625 lines
VERSION 2.00
Begin Form Form1
BackColor = &H00C0C0C0&
Caption = "Mitromar MIDAT Control Example"
ClientHeight = 6600
ClientLeft = 96
ClientTop = 1248
ClientWidth = 7788
Height = 7020
Left = 48
LinkTopic = "Form1"
ScaleHeight = 6600
ScaleWidth = 7788
Top = 876
Width = 7884
Begin SSFrame Frame3D4
Caption = "Separator Options"
Font3D = 0 'None
ForeColor = &H00000000&
Height = 1404
Left = 4860
TabIndex = 50
Top = 3888
Width = 2760
Begin ListBox List2
BackColor = &H00C0C0C0&
Height = 984
Left = 132
TabIndex = 49
Top = 288
Width = 2544
End
End
Begin CommandButton btnForceNegative
Caption = "Force Neg Int"
Height = 408
Left = 6396
TabIndex = 47
Top = 6048
Width = 1188
End
Begin MiDateTime MiDat1
About = ""
DisplayFormat = 5 'dd/mm/yy 24:mm:ss
Height = 360
Interval = 1000
Left = 1284
Top = 6084
Width = 2712
End
Begin CommandButton btnRefresh
Caption = "Refresh"
Height = 408
Left = 4872
TabIndex = 45
Top = 6036
Width = 1188
End
Begin SSFrame Frame3D3
Caption = "Timer Interval"
Font3D = 0 'None
ForeColor = &H00000000&
Height = 636
Left = 4896
TabIndex = 0
Top = 5304
Width = 2760
Begin MaskEdBox mskInterval
Format = "#####"
Height = 288
Left = 1140
Mask = "#####"
MaxLength = 5
PromptChar = "_"
PromptInclude = 0 'False
TabIndex = 1
Top = 228
Width = 684
End
Begin CommandButton btnSet
Caption = "Set"
Height = 312
Left = 1980
TabIndex = 2
Top = 216
Width = 588
End
Begin Label label1
BackStyle = 0 'Transparent
Caption = "Thousands"
Height = 300
Left = 108
TabIndex = 3
Top = 276
Width = 1044
End
End
Begin SSFrame Frame3D2
Caption = "Display Format Options"
Font3D = 0 'None
ForeColor = &H00000000&
Height = 3504
Left = 4836
TabIndex = 4
Top = 336
Width = 2760
Begin ListBox List1
BackColor = &H00C0C0C0&
Height = 2904
Left = 108
TabIndex = 5
Top = 372
Width = 2544
End
End
Begin SSFrame Frame3D1
Caption = "Time Properties"
Font3D = 0 'None
Height = 5652
Left = 216
TabIndex = 39
Top = 300
Width = 4476
Begin Label lblLastStatus
BackStyle = 0 'Transparent
Caption = "Last Status"
Height = 564
Left = 1464
TabIndex = 48
Top = 4956
Width = 2772
WordWrap = -1 'True
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Last Status"
Height = 264
Index = 38
Left = 264
TabIndex = 46
Top = 4980
Width = 1008
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Formatted"
Height = 264
Index = 0
Left = 265
TabIndex = 6
Top = 312
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Year"
Height = 264
Index = 1
Left = 265
TabIndex = 7
Top = 600
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Month"
Height = 264
Index = 2
Left = 265
TabIndex = 8
Top = 840
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Day"
Height = 264
Index = 3
Left = 265
TabIndex = 9
Top = 1080
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Mon Abbr"
Height = 264
Index = 4
Left = 265
TabIndex = 10
Top = 1332
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Month Name"
Height = 264
Index = 5
Left = 265
TabIndex = 11
Top = 1596
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Day Abbr"
Height = 264
Index = 6
Left = 265
TabIndex = 12
Top = 1860
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Day Name"
Height = 264
Index = 7
Left = 265
TabIndex = 13
Top = 2124
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Date"
Height = 264
Index = 8
Left = 265
TabIndex = 14
Top = 2376
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Day of Week"
Height = 264
Index = 9
Left = 265
TabIndex = 15
Top = 2616
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Day of Year"
Height = 264
Index = 10
Left = 265
TabIndex = 16
Top = 2844
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Week of Year"
Height = 264
Index = 11
Left = 265
TabIndex = 17
Top = 3096
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Hour"
Height = 264
Index = 12
Left = 265
TabIndex = 18
Top = 3336
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Minute"
Height = 264
Index = 13
Left = 265
TabIndex = 19
Top = 3588
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Second"
Height = 264
Index = 14
Left = 265
TabIndex = 20
Top = 3816
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Time Zone"
Height = 264
Index = 15
Left = 265
TabIndex = 21
Top = 4068
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Time"
Height = 264
Index = 16
Left = 265
TabIndex = 22
Top = 4284
Width = 1260
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "AmPm"
Height = 264
Index = 17
Left = 265
TabIndex = 23
Top = 4488
Width = 1260
End
Begin Label lblFormattedTime
BackStyle = 0 'Transparent
Caption = "Date"
Height = 264
Left = 1465
TabIndex = 24
Top = 288
Width = 2496
End
Begin Label lblYear
BackStyle = 0 'Transparent
Caption = "Year"
Height = 264
Left = 1465
TabIndex = 25
Top = 540
Width = 1032
End
Begin Label lblMonth
BackStyle = 0 'Transparent
Caption = "Month"
Height = 264
Left = 1465
TabIndex = 26
Top = 816
Width = 2496
End
Begin Label lblDayofMonth
BackStyle = 0 'Transparent
Caption = "Day"
Height = 264
Left = 1465
TabIndex = 27
Top = 1056
Width = 2496
End
Begin Label lblMonthAbbr
BackStyle = 0 'Transparent
Caption = "Mon Abbr"
Height = 264
Left = 1465
TabIndex = 28
Top = 1308
Width = 2496
End
Begin Label lblMonthName
BackStyle = 0 'Transparent
Caption = "Month Name"
Height = 264
Left = 1465
TabIndex = 29
Top = 1572
Width = 2496
End
Begin Label lblWeekDayAbbr
BackStyle = 0 'Transparent
Caption = "Day Abbr"
Height = 264
Left = 1465
TabIndex = 30
Top = 1836
Width = 2496
End
Begin Label lblWeekDayName
BackStyle = 0 'Transparent
Caption = "Day Name"
Height = 264
Left = 1476
TabIndex = 31
Top = 2100
Width = 2496
End
Begin Label lblDate
BackStyle = 0 'Transparent
Caption = "Date"
Height = 264
Left = 1465
TabIndex = 32
Top = 2352
Width = 2496
End
Begin Label lblWeekDay
BackStyle = 0 'Transparent
Caption = "Day of Week"
Height = 264
Left = 1465
TabIndex = 33
Top = 2592
Width = 2496
End
Begin Label lblDayofYear
BackStyle = 0 'Transparent
Caption = "Day of Year"
Height = 264
Left = 1488
TabIndex = 34
Top = 2820
Width = 2496
End
Begin Label lblWeekofYear
BackStyle = 0 'Transparent
Caption = "Week of Year"
Height = 264
Left = 1465
TabIndex = 35
Top = 3072
Width = 2496
End
Begin Label lblHourTwelve
BackStyle = 0 'Transparent
Caption = "Hour"
Height = 264
Left = 1465
TabIndex = 36
Top = 3312
Width = 2496
End
Begin Label lblMinute
BackStyle = 0 'Transparent
Caption = "Minute"
Height = 264
Left = 1465
TabIndex = 37
Top = 3564
Width = 2496
End
Begin Label lblSeconds
BackStyle = 0 'Transparent
Caption = "Second"
Height = 264
Left = 1465
TabIndex = 38
Top = 3792
Width = 2496
End
Begin Label lblTimeZone
BackStyle = 0 'Transparent
Caption = "Time Zone"
Height = 264
Left = 1512
TabIndex = 44
Top = 3996
Width = 2496
End
Begin Label lblTime
BackStyle = 0 'Transparent
Caption = "Time"
Height = 264
Left = 1465
TabIndex = 43
Top = 4260
Width = 2496
End
Begin Label lblAmPm
BackStyle = 0 'Transparent
Caption = "AmPm"
Height = 264
Left = 1465
TabIndex = 42
Top = 4464
Width = 2496
End
Begin Label lbl_type
BackStyle = 0 'Transparent
Caption = "Interval"
Height = 264
Index = 36
Left = 265
TabIndex = 41
Top = 4752
Width = 1140
End
Begin Label lblInterval
BackStyle = 0 'Transparent
Caption = "Interval"
Height = 264
Left = 1488
TabIndex = 40
Top = 4680
Width = 2496
End
End
End
Option Explicit
Sub btnForceNegative_Click ()
midat1.Interval = -1 ' placing a negative number in interval
' will force one second interval
End Sub
Sub btnRefresh_Click ()
' refresh also rebuilds all properties
midat1.Refresh
reset_lbls
End Sub
Sub btnSet_Click ()
' Set an inteval
If Val(mskInterval.Text) < 0 Then
MsgBox "Interval must be >= 0", 0, "Interval Value Error"
mskInterval.SetFocus
Else
midat1.Interval = Val(mskInterval.Text)
btnSet.Default = False
End If
End Sub
Sub Form_Activate ()
reset_lbls
mskInterval.Text = Format(midat1.Interval, "#0")
End Sub
Sub Form_Load ()
' load display format options
list1.AddItem IFORMAT_MIDAT_MDYHMS
list1.AddItem IFORMAT_MIDAT_YMDHMS
list1.AddItem IFORMAT_MIDAT_DMYHMS
list1.AddItem IFORMAT_MIDAT_MDY24MS
list1.AddItem IFORMAT_MIDAT_YMD24MS
list1.AddItem IFORMAT_MIDAT_DMY24MS
list1.AddItem IFORMAT_MIDAT_MDY
list1.AddItem IFORMAT_MIDAT_YMD
list1.AddItem IFORMAT_MIDAT_DMY
list1.AddItem IFORMAT_MIDAT_HMS
list1.AddItem IFORMAT_MIDAT_HM
list1.AddItem IFORMAT_MIDAT_24MS
list1.AddItem IFORMAT_MIDAT_24M
midat1.DisplayFormat = 0
list1.ListIndex = -1
' load separator options
list2.AddItem ISEPARATOR_MIDAT_SLASH
list2.AddItem ISEPARATOR_MIDAT_DASH
list2.AddItem ISEPARATOR_MIDAT_PERIOD
list2.AddItem ISEPARATOR_MIDAT_BAR
list2.ListIndex = -1
End Sub
Sub List1_Click ()
If list1.ListIndex <> -1 Then
midat1.DisplayFormat = list1.ListIndex
lblFormattedTime.Caption = midat1.FormattedTime
End If
End Sub
Sub List2_Click ()
If list2.ListIndex <> -1 Then
midat1.Separator = list2.ListIndex
End If
End Sub
Sub MiDat1_Change ()
reset_lbls
End Sub
Sub midat1_timer ()
reset_lbls
End Sub
Sub mskInterval_GotFocus ()
btnSet.Default = True
End Sub
Sub mskInterval_LostFocus ()
btnSet.Default = False
End Sub
Sub reset_lbls ()
lblFormattedTime.Caption = midat1.FormattedTime
lblYear.Caption = Str(midat1.Year)
lblMonth.Caption = Str(midat1.Month)
lblDayofMonth.Caption = Str(midat1.DayofMonth)
lblMonthAbbr.Caption = midat1.MonthAbbr
lblMonthName.Caption = midat1.MonthName
lblWeekDayAbbr.Caption = midat1.WeekDayAbbr
lblWeekDayName.Caption = midat1.WeekDayName
lblDate.Caption = midat1.Date
lblWeekDay.Caption = Str(midat1.WeekDay)
lblDayofYear.Caption = Str(midat1.DayofYear)
lblWeekofYear.Caption = Str(midat1.WeekofYear)
lblHourTwelve.Caption = Str(midat1.HourTwelve) '+ Str(midat1.hour24)
lblMinute.Caption = Str(midat1.Minute)
lblSeconds.Caption = Str(midat1.Seconds)
lblTimeZone.Caption = midat1.TimeZone
lblTime.Caption = midat1.Time
lblAmPm.Caption = midat1.AmPm
lblInterval.Caption = Str(midat1.Interval)
Select Case midat1.LastStatus
Case ISTATUS_MIDAT_NO_CHANGE
lblLastStatus.Caption = ITEXT_MIDAT_NO_CHANGE
Case ISTATUS_MIDAT_NO_PROBLEM
lblLastStatus.Caption = ITEXT_MIDAT_NO_PROBLEM
Case ISTATUS_MIDAT_FORCE_ONE_SECOND
lblLastStatus.Caption = ITEXT_MIDAT_FORCE_ONE_SECOND
Case ISTATUS_MIDAT_NO_TIMER_AVAILABLE
lblLastStatus.Caption = ITEXT_MIDAT_NO_TIMER_AVAILABLE
End Select
End Sub