i Have an application functionaluty which has 4 forms which are needed to interact by the user by dragging data from these forms to one another
the main form is located in the MDI Parent and the rest are on their respective screen (3 other secondry screens)
At the moment i am testing using 2 screens but i get a very similar behavious when i run it on a 4 screened system.
For the 2 screen system:
form1 opens in primary screen (ie the MDI Parent)
form2 opens in 2nd screen
form3 opens in 1st screen (primary)
form 4opens in 2nd screen
for the 4 screened system:
form1 opens in primary screen (ie the MDI Parent)
form2 opens in 2nd screen
form3 opens in 1st screen (primary)
form 4opens in 2nd screen
When this feature is requested by the user, form1 opens
form1 has the following code which opens form2, form3, and form4 in their respective screens
following is the code in method called by form_load within form1
Expand|Select|Wrap|Line Numbers
- private void openForms()
- {
- Form2 form2 = new Form2();
- Form3 form3 = new Form3();
- Form4 form4 = new Form4();
- Screen[] screens = Screens.AllScreens;
- if(screens.Length == 2)
- {
- List<Screen> lstScreen = new List<Screen>();
- foreach(Screen screen in Screen.AllScreens)
- {
- if(screen.Primary == false)
- lstScree.Add(screen);
- }
- form2.Location = lstScreen[0].WorkingArea.Location;
- form3.Location = lstScreen[0].WorkingArea.Location;
- form4.Location = lstScreen[0].WorkingArea.Location;
- }
- else if(screens.Length == 4)
- {
- List<Screen> lstScreen = new List<Screen>();
- foreach(Screen screen in Screen.AllScreens)
- {
- if(screen.Primary == false)
- lstScree.Add(screen);
- }
- form2.Location = lstScreen[0].WorkingArea.Location;
- form3.Location = lstScreen[1].WorkingArea.Location;
- form4.Location = lstScreen[2].WorkingArea.Location;
- }
- }
so cant figure out why form3 appears on the primary screen, but form4 appears back onto the 2nd screen.
Any help is appreciated, Thankyou
-Shashi