Hi,
I want to move the mouse pointer only on snap points which may be float or int value .My graphics unit is in millimeter.

Cursor.Position accepts only int value. So is there some other method or procedure from which it can be done.

For example

I want the mouse pointer to move on 2.5 multiples.

(100 , 50) (102.5, 50)........
(100,52.5) (102.5, 52.5)................
..............................

Thanks

The mouse position is in pixels which is relative to the display settings on the display adapter. You can do the math yourself to convert the values. Can you upload a sample project demonstrating the drawing unit where you want to snap the cursor? You may be better off drawing a "Dot" below the cursor that snaps to the nearest segment instead of snapping the actual cursor because that will make it very "jerky" to use. But you could allow the pointer to free float and just draw a bold * on the snapped coordinates.

To my knowledge I have never seen software that snaps the cursor like you are describing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.