With Windows Forms on multimonitor systems is it possible to set the location of the Form on ShowDialog() to something specific other than enumerations found within the StartPosition enumerations? I have tried the Manual enumeration with declaration of the Location Property, but that will choose the location on the Primary Display for Windows, which is not necessarily the window of the caller.
My optimal solution would be to locate the form in relation to the Mouse Pointer at the time of the function call.
You should be able to get the mouse position and set the location to it. There are two ways I can think of right off the bat.
Use the Cursor class to get the position. You can try
this.Location = new Point(Cursor.Position.X, Cursor.Position.Y);or something similar if it’s available in your language (I’m assuming so).You can use the GetCursorPos function. If you’re using C# or VB then you will have to define it. More information can be found on pinvoke: http://www.pinvoke.net/default.aspx/user32.getcursorpos