Results 1 to 3 of 3

Thread: Marquee Box

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    I left my msdn cd at home at cant use the help today :~(
    does anyone know if there is a marquee box control for vb?

    Marquee box as being, like a text box, but scrolls the text, say from right to left across.

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Wink hehe

    I don't mean to laugh, but the latest MSDN stuff is all on line.

    http://msdn.microsoft.com/library/default.asp

    Sorry I can't help with your specific question, but at least you now have access to the resource...



    ~seaweed

  3. #3
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    Lightbulb Here's an idea for you, though

    This code uses a timer to scroll text in a text box (or you can use a label, a form caption, or whatever you want that displays text).

    Strech a text box across a form, drop a timer on the form, keep the default control names, and paste the following into the form's code window:
    Code:
    Option Explicit
    
    Private sMsg As String                      'Holds the scrolling message text
    Private nStartPos As Integer                'Counter
    Const TEXT_DISPLAY_LENGTH As Integer = 50   'Width of text to display
    
    Private Sub Form_Load()  
        ' Right-justfiy text box
        Text1.Alignment = 1
        
        ' I think it's less jerky with a fixed character length font (not sure, though)
        Text1.Font = "Courier New"
        
        ' Set timer interval
        Timer1.Interval = 100
    
        'I create a long message here. You can add whatever you want.
        sMsg = "Hello, how are you today? "
        sMsg = sMsg & "I am fine. "
        sMsg = sMsg & "Nice weather we're having. "
        sMsg = sMsg & "Did you catch the game last night? "  
    End Sub
    
    Private Sub Timer1_Timer()
        nStartPos = nStartPos + 1
        
        If nStartPos > Len(sMsg) Then
            nStartPos = 1
        End If
        
        Text1 = Right$(Text1 & Mid$(sMsg, nStartPos, 1), TEXT_DISPLAY_LENGTH)
    End Sub
    ~seaweed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width