|
-
Oct 8th, 2003, 12:30 AM
#1
Thread Starter
Lively Member
picturebox click coordinates?
this is probably really simple,but how do you get the X and Y coordinates when a picturebox is clicked?
-
Oct 8th, 2003, 12:37 AM
#2
Addicted Member
Well, I don't know where you want to put the coordiantes(textboxes, labels, etc), but this should work for you.
VB Code:
Private Sub picBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picBox.Click
TextBox1.Text = picBox.Location.X
TextBox2.Text = picBox.Location.Y
End Sub
Take my love
Take my land
Take me where I cannot stand
I don't care, I'm still free
You can't take the sky from me...
-
Oct 8th, 2003, 12:51 AM
#3
Actually that will give you the location of the picturebox itself. I think he wants the location of the mouse or click. Try using the MouseDown event instead which will tell you the click, X, Y and some other things from the e argument.
-
Oct 8th, 2003, 12:54 AM
#4
Addicted Member
OOoohhh. Sorry. Yeah, I guess you're probably right. That's what I get for being a newbie eager to help other people I guess. Soemtimes I get exited when I think I know the answer, and post too quickly.
Take my love
Take my land
Take me where I cannot stand
I don't care, I'm still free
You can't take the sky from me...
-
Oct 8th, 2003, 01:17 AM
#5
Thread Starter
Lively Member
thanks, that did it, MouseDown, should have known that.
-
Oct 8th, 2003, 01:27 AM
#6
Addicted Member
location of picture control - repeater
will this work if the pictue is athumbnail in a series of entries bound to a repater control, say things for sale. Would I need to know which index in the repeater is selected and then use the co-ordinaes above ???
bh
-
Oct 8th, 2003, 01:34 AM
#7
The picturebox in question should be passed as the sender argument and the x,y info will be in the e argument.
-
Oct 8th, 2003, 01:41 AM
#8
Addicted Member
picture box
thanks edneeis - that makes sense, but with a repater, is there a selected index ?? is this what I would pass
BH
-
Oct 8th, 2003, 02:06 AM
#9
I'm not sure I haven't worked with the repeater but if its an event you shouldn't have to pass anything it should be passed by the control.
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
|