i'm just curious, can we make scrolling text without using a Timer? (like scrolling text for news in television)

Recommended Answers

All 6 Replies

Hi, as far as I know you will need a timer to get the text scrolling. But a scrolling text like for news in television is easy to make. Give your Form the size you want it to be and the location where you want it to be on your screen. In the properties menu for your Form set startposition to manual and it will show up where you located it. I use a label with the text I want that moves on top of the Form.

hi Ge48, my form set to maximized, i don't really understand with your point, can you expalin more? with your way for scrolling text, is it still use a timer?

If you want to do something repeatedly you have three basic chouces

  1. Get the user to inititate the action each time (e.g. click something). This will be too inconvenient for the user.
  2. Use a loop (you'd need to sleep between iterations). This will make the application less responsive. If the application has to do anything else you'll have to jump through hoops to make it work.
  3. Use a timer. This is by far the easiest choice.

Hi artemix22, it does use a timer, don't know any other way to do it. I will post the code I use a bit later today, along with a little explantion.

Hi again, like I said before the code in itelf is easy. The main thing of it is in the design part of your project. Just set the right properties for all you want. Please post the steps you have taken in building your project sofar. Then I can give you pointers in what to do.

Hi, to give you a start (I used a screensize 1024 x 768 for this) place a label on your form and in the properties menu change the font to something bigger (like fontsize 36), type a text in it and give it the location 1024; 0. The label disapears at the right side of your screen. Place a timer on the form and in properties menu set the interval to 1. In your form load place the line Timer1.Start() else nothing will happen. Use the code below for the timer, run the project and see what happens.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Left -= 1
        If Label1.Left = -(Label1.Width) Then
            Label1.Location = New Point(1024, 0)
        End If
    End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.