|
-
Jun 27th, 2009, 03:23 PM
#1
Thread Starter
Hyperactive Member
Manipulating a control's location property.
Hey,
This one has me stumped. I'm trying to change the location of an object's X position so that it has a marquee like effect. I'm doing this with buttons and text, etc...
I've been experimenting with code:
Code:
PictureBox1.Location = New Point(PictureBox.Location.X - 10, PictureBox.Location.Y)
With the intention of it moving 10px to the left. I would then use a timer, but it scrolls automatically for me, why?
If I try,
Code:
PictureBox1.Location = New Point(51,50)
where the Picture is previously at 50,50 it will not do this. Why?
Finally, what I want to know is:
If I use:
Code:
PictureBox1.Location = New Point(PictureBox.Location.X - 10, PictureBox.Location.Y)
which seems great (different - affects the speed). How do I get it to return on the other side of the screen?
Thanks
If you found any of my posts helpful then please rate them.
CodeBank
Form Fading Effects in VB.NET and C#
-
Jun 27th, 2009, 03:30 PM
#2
Re: Manipulating a control's location property.
If your using a timer for the first code then yes it would continue scrolling because you reference the controls Current X location, which changes each time.
As for your second question, I don't think you can get it to return on the otherside just like a marquee does where it splits perfectly. But you can check the pictureboxes location and once it reaches 0 - the width of your picturebox, you can reset the X location to Me.Width - PictureBox.Width
-
Jun 27th, 2009, 07:13 PM
#3
Thread Starter
Hyperactive Member
Re: Manipulating a control's location property.
It should not cause a scrolling effect as the timer effect is 60 secs however I know what to do now.
I will place return the objects to the end when they reach it and continue the behaviour
Thanks
If you found any of my posts helpful then please rate them.
CodeBank
Form Fading Effects in VB.NET and C#
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|