Use the Control.PointToClient
method. Assuming this
points to the form in question:
var relativePoint = this.PointToClient(new Point(X, Y));
Or simply:
var relativePoint = this.PointToClient(Cursor.Position);
More Related Contents:
- Cursor.Current vs. this.Cursor
- How can I make the cursor turn to the wait cursor?
- read text file chunks by chunks by scrollbar [closed]
- Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on
- How do I rotate a picture in WinForms
- How to deploy application with sql server database on clients
- Determine what control the ContextMenuStrip was used on
- C# Validating input for textbox on winforms
- How do you prevent a windows from being moved?
- How to force C# .net app to run only one instance in Windows? [duplicate]
- A textbox/richtextbox that has syntax highlighting? [C#] [closed]
- How to create custom PropertyGrid editor item which opens a form?
- Open link in new TAB (WebBrowser Control)
- How to get selected text of any application into a windows form application
- How to create a C# Winforms Control that hovers
- Custom Caret for WinForms TextBox
- How to read another windows from a different program
- ‘Forms’ does not exist in the namespace system.windows
- Hosting ASP.NET Core API in a Windows Forms Application
- How to make a button appear as if it is pressed?
- Only allow specific characters in textbox
- Passing data between two forms with properties [duplicate]
- Updating UI in C# using Timer
- How to refresh datagridview when closing child form?
- DataGridView Image for Button Column
- Change ComboBox Border Color in Windows Forms
- How do I make custom controls in C#? [closed]
- Winform – determine if mouse has left user control
- Passing a variable between Windows Forms forms
- Exposing events of underlying control