Using C#, how do I lock a mouse inside a window for gaming purposes
I wanted to add this feature to my program but I don't know what to google or the functions needed to do this. Its for Wacraft3 on window mode. I want the mouse to get lo开发者_如何学Gocked inside the window when the window is active. thanks.
Use Cursor.Clip:
Cursor.Clip = yourForm.RectangleToScreen(yourForm.ClientRectangle);
精彩评论