I'm on a thread other than the UI thread and need to display a modal form that's centered on the application's main form. What I usually do is use the width and height of the main form and the modal form to calculate the location, then use the PointToScreen method of the main form to get the location of the modal form. Since I'm on another thread I need to use Control.Invoke to call this method. I just can't figure out how to pass a parameter of type Point to Control.Invoke (params object[]). Value types and String works fine.
Or, if someone can find a better way to display a form centered on the main form regardless of thread, that would be great. MessageBox seems to be able to do this (although not modally).
EDIT
I have no problem calling something like this.
mainform.Invoke(..., object[] { someString });
The problem is this:
public Point Control.PointToScreen(Point p)
This method takes a Point as a parameter and returns a Point. How can I call this via Control.Invoke?