How do you split code between events?
Specifically, activate InputBox before the on timer event fires. Should timer interval initially be set at 0 or 250? Also, which events work in conjunction with On Timer? Double-clicking on a label doesn't seem to activate the on timer (although, not being a programmer, my attempt was wrong). Thanks.
John
----Code
Private Sub lblScroll_DblClick(Cancel As Integer)
Static strMsg As String, intLet As Integer, intLen As Integer
Dim strTmp As String
Dim strChng As Variant
Const TXTLEN = 90
If Len(strMsg) = 0 Then
strChng = InputBox("Create scrolling message.", "Create scrolling message")
strMsg = Space(TXTLEN) & strChng ' & vbCrLf _
' & "www. .com/ " & Space(TXTLEN)
intLen = Len(strMsg)
End If
intLet = intLet + 1
If intLet > intLen Then intLet = 1
strTmp = Mid(strMsg, intLet, TXTLEN)
Me.lblScroll.Caption = strTmp
Me.lblScroll.ForeColor = (IIf(.ForeColor = vbBlue, vbBlack, vbBlue))
If Me.TimerInterval = 0 Then
Me.TimerInterval = 200
End If
End Sub
Specifically, activate InputBox before the on timer event fires. Should timer interval initially be set at 0 or 250? Also, which events work in conjunction with On Timer? Double-clicking on a label doesn't seem to activate the on timer (although, not being a programmer, my attempt was wrong). Thanks.
John
----Code
Private Sub lblScroll_DblClick(Cancel As Integer)
Static strMsg As String, intLet As Integer, intLen As Integer
Dim strTmp As String
Dim strChng As Variant
Const TXTLEN = 90
If Len(strMsg) = 0 Then
strChng = InputBox("Create scrolling message.", "Create scrolling message")
strMsg = Space(TXTLEN) & strChng ' & vbCrLf _
' & "www. .com/ " & Space(TXTLEN)
intLen = Len(strMsg)
End If
intLet = intLet + 1
If intLet > intLen Then intLet = 1
strTmp = Mid(strMsg, intLet, TXTLEN)
Me.lblScroll.Caption = strTmp
Me.lblScroll.ForeColor = (IIf(.ForeColor = vbBlue, vbBlack, vbBlue))
If Me.TimerInterval = 0 Then
Me.TimerInterval = 200
End If
End Sub