Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form on Specified Multiple Monitor 1

Status
Not open for further replies.

mocambique

Programmer
Jun 3, 2008
4
CA
I am working on a C# program that will open 2-3 forms based on how many multiple monitors the user has. I want each form to open on a specific monitor.

I can get the program to detect the number of monitors and open the appropriate number of forms but the forms do not go to the specified monitors but instead stay on the primary monitor.

I am trying to use the Bounds function to assign the position.

A code sample:

Code:
public void create_form1()
            {
            Form form1 = new Form();
            form1.Text = "form 1";
            form1.Bounds = Screen.AllScreens[0].Bounds;
            form1.Show();
}

Is there another parameter that I should be using to get the form to move to the proper monitor?
 
Form form1 = new Form();
form1.Text = "form 1";

form1.StartLocation = FormStartLocation.Manual;

form1.Bounds = Screen.AllScreens[0].Bounds;
form1.Show();

 
Thanks JurkMonkey.

Had to change the syntax slightly to get it to work.

Code:
form1.StartPosition = FormStartPosition.Manual;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top