|
|||||||||
|
|||||||||
|
|
|
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
#1
|
|||
|
|||
Is it possible to change the position of the mouse cursor/pointer?
What I want to do is to place mouse cursor/pointer to a control (button) when certin event occured (form load) Possible? how? |
#2
|
|||
|
|||
Hi,
On the form Load event, Paste the following code if button1 is the control where you want to move the mouse cursor Windows.Forms.Cursor.Position = New System.Drawing.Point(Button1.Location.X + Me.Location.X + 50, Button1.Location.Y + Me.Location.Y + 30) Nazer Mohideen Last edited by Nazer : December 3rd, 2003 at 06:02 PM. |
#3
|
|||
|
|||
I am just wondering why you are using the Location.X and Y and the +50 +30 ? is it only to center the cursor in the middle of the button or something else ?
cause I don't think it's a necessity, just that the cursor will be at the top left. ?? |
#4
|
|||
|
|||
Ya it is just to center the cursor
|
#5
|
|||
|
|||
Quote:
if you really want to center it Windows.Forms.Cursor.Position = New System.Drawing.Point(Button1.Location.X + (button1.width /2) , Button1.Location.Y + (button1.height /2) ) should work better. You are sure it's always the case. unless you are using all the time a standart button btw : thank you for your information
__________________
|
#6
|
|||
|
|||
thank you very much.
I was trying to change MousePosition, however it is read only. now I know I should take Cursor.Position... thanks guys |
Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > is it possible to "move" mouse cursor ? |
|
|
|
|
|