Syntax :
[ forrm! ].Name.Interval = milliseconds&
Form : Name property of the form
Name : Name property of the timer control being affected
milliseconds& : Amount of time that must pass between triggerings of the Timer event ( as a long integer )
[ forrm! ].Name.Interval = milliseconds&
Form : Name property of the form
Name : Name property of the timer control being affected
milliseconds& : Amount of time that must pass between triggerings of the Timer event ( as a long integer )
Setting of the Interval property
Value : Effect
0 : Disables the timer (default)
1-65535 : Milliseconds between triggerings ; 1000 = 1 second
Value : Effect
0 : Disables the timer (default)
1-65535 : Milliseconds between triggerings ; 1000 = 1 second
The Timer control's Enabled property determines whether the control responds to the passage of time. Set Enabled to False to turn a Timer control off, and to True to turn it on. When a Timer control is enabled, its countdown always starts from the value of its Interval property setting.
Option Explicit
Private Sub Form_Load()
Timer1.Interval = 900 ' Set interval.
HScroll1.Min = 100 ' Set minimum.
HScroll1.Max = 900 ' Set maximum.
End Sub
Private Sub HScroll1_Change()
' Set interval according to scroll bar value.
Timer1.Interval = 1000 - HScroll1.Value
End Sub
Private Sub Timer1_Timer()
' Switch BackColor between red and blue.
If Picture1.BackColor = RGB(255, 0, 0) Then
Picture1.BackColor = RGB(0, 0, 255)
Else
Picture1.BackColor = RGB(255, 0, 0)
End If
End Sub
Private Sub Form_Load()
Timer1.Interval = 900 ' Set interval.
HScroll1.Min = 100 ' Set minimum.
HScroll1.Max = 900 ' Set maximum.
End Sub
Private Sub HScroll1_Change()
' Set interval according to scroll bar value.
Timer1.Interval = 1000 - HScroll1.Value
End Sub
Private Sub Timer1_Timer()
' Switch BackColor between red and blue.
If Picture1.BackColor = RGB(255, 0, 0) Then
Picture1.BackColor = RGB(0, 0, 255)
Else
Picture1.BackColor = RGB(255, 0, 0)
End If
End Sub
No comments:
Post a Comment