Answered Scrolling text...

PRo-Beaniie

Well-known member
Joined
Mar 17, 2011
Messages
55
Location
Hertford, Hertfordshire, United Kingdom
Programming Experience
3-5
Hey guys,

its been a while scince i last posted in this forum, but now im back :p Im now studying a national diploma! Anyhoo, im currently working on this project for my next assignment however i have run into some problems. I have been looking on the net for a while, to find a way to scroll text in a label. I came across several ways to accomplish this but the most effective is this one I have found. The problem im having is when i use a label the text scrolling from right to left finshes but respawns as whole words and not a smooth continuos run of words. another problem im having is identifying what text i want to be displayed in this label. This label is continuosly changing to tell the user what to do next.

I wanted to link the already constructed label statements, to just assume thier place in the label.. ( im not very good at explaining these things... )

Thanks in advance
VB.NET:
    Private Sub Tmr2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tmr2.Tick
        'Text Scrolling...
        Static counter As Integer = 0

        Dim scrollingText As String = LblPrpt.Text '<< This I have changed to lbl.prpt.text but I get a string error.
        If counter = scrollingText.Length Then counter = 0
        LblPrpt.Text = scrollingText.Substring(counter) & scrollingText & scrollingText & scrollingText
        counter += 1
    End Sub

My solution to this was to place the text within a panel and rather than make the text within the label move, i would make the label move and define the edges of the panel as triggers to reset the label to the beggining.
 
Last edited:
Back
Top