Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMake an ActiveX control that automatically scrolls text
Keywordsscroll text, text scroller, ActiveX, control
CategoriesControls, 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.
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated