Question scroll label in panel

PRo-Beaniie

Well-known member
Joined
Mar 17, 2011
Messages
55
Location
Hertford, Hertfordshire, United Kingdom
Programming Experience
3-5
Hey guys as i posted in my last topic i needed to find a way to make text scroll i have found this solution but ive been working all day and my head is scrambled! i cant see where im going wrong here... The text is supposed to scroll down and re-appear at the top, i used a panel to define the areas i want the lable to remain within. however now all thats happening is the label scrolls down and does not re appear... its probably somthing really measly or stupid but i cant see it a little help would be much appreciated..

Thanks in advance

VB.NET:
 'Text Scrolling sidways... (This one works fine)
        LblBon1.Left -= 5
        If LblBon1.Left < -Pnl1.Width - 100 Then
            LblBon1.Left = Pnl1.Width
        End If
        'Text Scrolling Downwards... (This one is being argumentative!)
        LblPrpt.Top += 5
        If LblPrpt.Top > Pnl2.Height Then
            LblPrpt.Top = Pnl2.Top
        End If
 
The Label is inside the Panel so it's Top and Left properties should be set relative to the Panel. By using the Top property of the Panel you are setting it relative to the form. If you want the Label at the top of the Panel then what should the Label's top be? Zero, right? In actual fact, you'll probably want to use zero less the Height of the Label, so it starts completely outside the visible area.
 

Latest posts

Back
Top