Results 1 to 9 of 9

Thread: Moving text on status bar

  1. #1

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38

    Question

    Hi there...
    How can i get a moving text on a status bar control?
    Does anybody know some code????

    betto
    [email protected]

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Cool

    If you mean how to scroll the text you can set a timer to run this:

    Code:
    Private Sub Timer1_Timer()
        StatusBar.Panels(1).Text = Mid(StatusBar.Panels(1).Text, 2) & Left(StatusBar.Panels(1).Text, 1)
    End Sub
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38

    Cool It's almost

    it's almost...
    I meant throw the status bar... from right to left.
    Besides it's in style 1 ... it's with simpletext property.

    i got it.. but i used a big space " "
    or larger, later i started to cut it... but it's not seem to me something elegant..

    Do you know something better???

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Talking

    You may throw a panel from right to left, if you put a panel before it (with no bevel) to go smaller and smaller...
    Hope this wasn't what you didn't want
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38

    Talking

    I made this:

    Code:
    Private Sub Form_Load()
    StatusBar1.SimpleText = "[email protected]"
    End Sub
    
    Private Sub Timer1_Timer()
    StatusBar1.SimpleText = " " & StatusBar1.SimpleText
    If Len(StatusBar1.SimpleText) > 250 Then
        StatusBar1.SimpleText = "[email protected]"
    End If
    End Sub
    but it reaches only the half of status bar in style 1.

    I dont exactly how long the status bar is... and if it have a middle panel.. because the text disapear at the half

    Why???

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Wink

    Don't ask me, the statusbar control, is not good enough for you. Try setting up another panel, doing this thing, and move your text by setting the width of that panel.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38
    Ok...
    but .. why do you bother at me??

    I hope I wouldn't have said anything which offend you..


    betto



  8. #8
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Try:
    Code:
    Private Sub Form_Load()
        StatusBar1.Panels(1).Width = ScaleWidth
        StatusBar1.Tag = "[email protected]"
        StatusBar1.Panels(1) = StatusBar1.Tag
        Timer1.Interval = 100
    End Sub
    
    Private Sub Timer1_Timer()
        If (TextWidth(StatusBar1.Panels(1)) - TextWidth(StatusBar1.Tag)) < StatusBar1.Panels(1).Width Then
            'Move it to the Right
            StatusBar1.Panels(1) = " " & StatusBar1.Panels(1)
        Else
            StatusBar1.Panels(1) = StatusBar1.Tag
        End If
    End Sub
    [Edited by Aaron Young on 04-13-2000 at 04:42 PM]

  9. #9

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38

    Cool Thanks!!!

    Thanks Aaron..

    Your code is cool
    see you soon...

    betto
    [email protected]

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