By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,215 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

[C# 2.0 Windows Form] Form start position on a different screen

Shashi Sadasivan
Expert 100+
P: 1,435
Hi All,
I will start working on a form soon which runs as an mdi container (in the main screen)
However there is this "new" requirement, there will be 4 screens, and one of the features of the program is to open child forms (not within the mdi container) but in a totally different screen (as in a second one, not the primary one).
Now it is going to be a quad screen system. not even 2.
I wrote a small snippet

Expand|Select|Wrap|Line Numbers
  1. Form frm1 = new Form();
  2.  
  3. Screen[] screens = Screen.AllScreens;
  4. foreach (Screen scrn in screens)
  5. {
  6. if (scrn.Primary == false)
  7.  {
  8.   frm1.Bounds = scrn.Bounds;
  9.   frm1.StartPosition = FormStartPosition.Manual;
  10.   frm1.Show();
  11.  }
  12. }
would this code mean that frm1 will open up in the secondry screen?
if so how can i distinguish which one of the secondry screen i am looking for.
I would have 1 primary and 3 secondry screens.

*scracthing my head until i even get 2 monitors*
Nov 8 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.