Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
XML RSS Feed
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
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-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated