Private Sub cmdDown_MouseDown(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
m_Increment = -1
tmrNumber.Enabled = True
End Sub
Private Sub cmdDown_MouseUp(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
tmrNumber.Enabled = False
End Sub
Private Sub cmdUp_MouseDown(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
m_Increment = 1
tmrNumber.Enabled = True
End Sub
Private Sub cmdUp_MouseUp(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
tmrNumber.Enabled = False
End Sub
Private Sub tmrNumber_Timer()
Const MIN_NUMBER = -100
Const MAX_NUMBER = 100
m_Number = m_Number + m_Increment
If m_Number < MIN_NUMBER Then
m_Number = MIN_NUMBER
ElseIf m_Number > MAX_NUMBER Then
m_Number = MAX_NUMBER
End If
txtNumber.Text = Format$(m_Number)
End Sub
|