|
-
Jan 27th, 2002, 09:59 PM
#1
Thread Starter
Hyperactive Member
mouse click
can anyone help me out? i need to capture mouseclicks as well as coordinates only within a certain picturebox. the program should not detect any mouse events once the cursor falls outside the picturebox of my application.
thanks in advance
-
Jan 28th, 2002, 05:11 AM
#2
if your picturebox is called Picture1, you will have the following event for mouse-clicks.
VB Code:
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Your code here
End Sub
Notice the parameters to it - "button" to say which mouse button, "shift" I think says the shift/ctrl/alt keys, "x" and "y" you can probably guess...
-
Jan 28th, 2002, 05:20 AM
#3
Thread Starter
Hyperactive Member
thanks
thanks for your help. i'll try out the code. btw, when it captures the coordinates, will the coordinates correspond to the picturebox only or is the coordinate refer to the mouse position in the monitor screen as a whole? (eg, if i click on the upper left hand corner of the picture box, will it return coordinates 0,0 or otherwise?)
can VB also detect mouseclick using opengl? since i'm using opengl with VB, can i detect mouse clicks and subsequently capture its coordinates in that opengl drawing context?
-
Jan 28th, 2002, 05:25 AM
#4
from putting this code in that sub:
MsgBox X & vbCr & Y
you can see that it is relative to the picturebox only.
no idea about open-gl, sorry!
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
|