|
|
Title | Make an ActiveX control that automatically scrolls text |
Keywords | scroll text, text scroller, ActiveX, control |
Categories | Controls, ActiveX, ActiveX Controls |
|
|
The ActiveX control uses a Timer control to draw the text repeatedly and shofted slightly.
|
|
Private CurY As Single
' Move the text a little bit.
Private Sub tmrDisplay_Timer()
If Not Ambient.UserMode Then Exit Sub
Cls
CurrentY = CurY
CurrentX = 0
Print m_Text
Select Case m_Direction
Case scrollerTopToBottom
CurY = CurY + m_Distance
If CurY > ScaleHeight Then
Enabled = False
RaiseEvent ScrollingDone
End If
Case scrollerBottomToTop
CurY = CurY - m_Distance
If CurrentY < 0 Then
Enabled = False
RaiseEvent ScrollingDone
End If
End Select
End Sub
|
|
For lots of other useful ActiveX controls like this one, see my book Custom Controls Library. The book's Web page includes a list of the controls it contains.
|
|
|
|
|
|