vb6 - How to read/show the current mouse pointer coordinates in picturebox when on runtime? -
when run time, need add many image on picture box, have many image , wish connect picture1.line. need know actual coordinate on start point end point(in run time).
any example or idea how read/show coordinate of mouse pointer?
in vb6 can way. create new form , add following code:
option explicit private type pointapi 'type hold coordinates x long y long end type 'function gets current position private declare sub getcursorpos lib "user32" (lppoint pointapi) 'on mouse move, update form private sub form_mousemove(button integer, shift integer, x single, y single) dim rect pointapi 'get position getcursorpos rect 'print coordinates me.cls print "current x = " & rect.x print "current y = " & rect.y end sub
Comments
Post a Comment