Your problem is that your label is "contained" within the picturebox. Therefore, the coordinates of the label are taken from the picturebox (i.e. the coordinate 0,0 of the label is the top left of the picturebox).
You are comparing the position of the label with the position of the picturebox, but the pictureboxes coordinates are taken from the form (i.e. the coordinate 0,0 of the picturebox is the top left of the form).
Therefore, the test
Code:
if (lblMarquee.left + lblMarquee.width) <= picMarqueeBack.left Then
will depend on the position of the picturebox in accordance with the form. If you move the picturebox further right in the form, the label will move even less to the left.
Because the label is contained within the picturebox, you can just use 0 to find out when the label has moved out of the pictureboxes viewing area.
Code:
if (lblMarquee.left + lblMarquee.width) <= 0 Then
That should let it scroll all the way across the picturebox.
As far as taking this project further, to try and cut out the flashing, you'll need to get into back buffering, and blitting. There's tons of stuff about this in this forum, with some great examples (check out the
Interface and Graphics forum for more info). In a simple form, this would involve two pictureboxes. One hidden (the back buffer) and one visible (the view). You draw to the back buffer which is hidden, and then use the BitBlt API to copy the back buffer picturebox into the view. You can also do away with the back buffer picturebox, and manipulate memory directly, but when using text the Pictureboxes Print method is useful.