|
-
Feb 27th, 2006, 05:38 PM
#1
Thread Starter
New Member
[RESOLVED] Object Location
If i wanted to use cursor coordinates to set the location for an object lets say a picturebox, so that wherever the cursor went, the object went, how would i go about doing that, since location (x,y) is a value and therefore cannot be the target of an assignment.
I know how to do cursor coordinates already.
-
Feb 27th, 2006, 05:53 PM
#2
Re: Object Location
What if you took the coordinates in the mouseMove event and assigned the x,y to the Top and Left properties of the control?
My usual boring signature: Nothing
 
-
Feb 27th, 2006, 06:23 PM
#3
Thread Starter
New Member
-
Feb 27th, 2006, 06:25 PM
#4
Re: [RESOLVED] Object Location
Oops, VB6 leaking through, I guess Top and Left have been replaced by Location.
My usual boring signature: Nothing
 
-
Feb 27th, 2006, 06:27 PM
#5
Thread Starter
New Member
Re: [RESOLVED] Object Location
nope its still there they just dont show it
-
Feb 27th, 2006, 07:14 PM
#6
Re: [RESOLVED] Object Location
If you want to get or set just the Top or Left property then you use the Top or Left property because the X and Y properties of the Location cannot be set through the Location property. If you want to set both the Top and Left properties then you create a Point object and set the Location property as this forces it to happen in one operation rather than two, which can be visible to the user.
If you want to know what that message about not being the target of an assignment means then just ask.
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
|