PDA

View Full Version : سوال: مختصات موس



papil2010
شنبه 26 تیر 1389, 16:53 عصر
سلام دوستان
چطور میشه مختصات موس رو با برنامه نویسی تغییر بدیم.
من خودم از این تابع api استفاده کردم اما نتیجه نگرفتم :

[DllImport("user32.dll", CharSet = CharSet.Unicode)]
static extern long SetCursorPos(long x,long y);

این تابع مختصات x رو تغییر میده اما y اون رو به طور خودکار صفر میزاره
ممنون میشم اگه کمک کنید:تشویق::تشویق:

ricky22
شنبه 26 تیر 1389, 17:51 عصر
private void MoveCursor()
{
// Set the Current cursor, move the cursor's Position,
// and set its clipping rectangle to the form.

this.Cursor = new Cursor(Cursor.Current.Handle);
Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);
Cursor.Clip = new Rectangle(this.Location, this.Size);
}



http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position.aspx