Jump to content

Scrolling Text

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Brettpach

Brettpach

    Newbie

  • Members
  • Pip
  • 6 posts
Does anyone have a good chunk of code that will scroll text horizontally from right to left. The string will be over 300 chars. Thanks for the help

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
What are you trying to scroll it in? (Textbox, Label, etc)

Here is a control for Visual Basic that does it: Overview - Scrolling Text Control - Developer Fusion: Connecting Developers Worldwide. C#, .NET, VB, Java, PHP and XML tutorials & source code

#3
Brettpach

Brettpach

    Newbie

  • Members
  • Pip
  • 6 posts
I am looking to use this a part of a dashboard application that will scroll kinda like a news ticker. The site above looks like a web control. that wont work for what im doin.

#4
Guest_NeedHelp_*

Guest_NeedHelp_*
  • Guests
Couldn't you create a label with the form background color and the preferred text in it. Then move the position of the label in a never ending loop? Probably not what you are looking for but I believe it would work!

#5
Brettpach

Brettpach

    Newbie

  • Members
  • Pip
  • 6 posts
Labels have a capped number of characters so this idea wouldn't work. I had one going but after 195 characters it failed I was just looking for an open source chunk of code that was already developed. I'm sure I can get this to work with time but I'm just trying to maximize efficiency, no sense reinventing the wheel. Again thank you for any help.

#6
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Here is one for .NET which may be what you are looking for:

Visual Basic.NET (VB.NET) Source Code: How to Show Scrolling Text in a Windows Forms Application - VB

#7
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well I think I can help you, and there should be no problems with the Label, if your string is 300 characters then make 2 labels (if one label holds 195 characters as you said) then just get the X axis of the label and always make it - 100 or something

Here is the Code for you, btw you can always use a Text box instead of a label :)
Make a timer with interval 500 (or value you want)
Private Sub Timer1_Timer()
Label1.Left = Label1.Left - 100
Label2.Left = Label2.Left - 100
End Sub

Then you can elaborate more so as to bring it back from the other side and to continue scrolling (it's simple, but it's your project right?)