473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C# WinApp : Open Forms in Multiple screen

Shashi Sadasivan
1,435 Expert 1GB
Hi All,
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
  1. private void openForms()
  2. {
  3.    Form2 form2 = new Form2();
  4.    Form3 form3 = new Form3();
  5.    Form4 form4 = new Form4();
  6.  
  7.    Screen[] screens = Screens.AllScreens;
  8.    if(screens.Length == 2)
  9.    {
  10.       List<Screen> lstScreen = new List<Screen>();
  11.       foreach(Screen screen in Screen.AllScreens)
  12.       {
  13.          if(screen.Primary == false)
  14.             lstScree.Add(screen);
  15.       }
  16.       form2.Location = lstScreen[0].WorkingArea.Location;
  17.       form3.Location = lstScreen[0].WorkingArea.Location;
  18.       form4.Location = lstScreen[0].WorkingArea.Location;
  19.    }
  20.    else if(screens.Length == 4)
  21.    {
  22.       List<Screen> lstScreen = new List<Screen>();
  23.       foreach(Screen screen in Screen.AllScreens)
  24.       {
  25.          if(screen.Primary == false)
  26.             lstScree.Add(screen);
  27.       }
  28.       form2.Location = lstScreen[0].WorkingArea.Location;
  29.       form3.Location = lstScreen[1].WorkingArea.Location;
  30.       form4.Location = lstScreen[2].WorkingArea.Location;
  31.    }
  32. }
While debugging it for the 2 screen system, i found that the Location of all the 3 forms is being set to -1280,0 even after the show method is executed the positions are shown to -1280,0

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
Jan 10 '08 #1
0 4547

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

Similar topics

55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
3
by: Hp | last post by:
Hello, Is it possible to have more than one record from the same table open on the screen using forms? If you have an contact list for example and want to check a phone number whilst editing an...
13
by: Ole Hanson | last post by:
Hi I am in need of a way to launch my WinForms-app (app.exe) just by pressing a keyboard combination like (Ctrl-Alt-P). This functionality should be present "out of the box" after the app...
4
by: Scott Johnson | last post by:
Hi! Is there a way to "preload" a form using a thread or something else so that my user doesn't have to wait 5 seconds (initializing time) between forms? Some of these forms have tab strips with...
2
by: John | last post by:
Hi I am opening a dialog using; frmdialog = New frmdialognew frmdialog.ShowDialog() Is there a way to see if this dialog is already open to avoid opening multiple instances of it?
3
by: Karan | last post by:
I am calling finalize when form2 loads and deactivates form1 which closes form1. However, same thing is not happening in form2 because finalize is already called. Does anybody has solution to it....
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
0
nev
by: nev | last post by:
I know when is best to use some templates but listed below are most that I don't know when is best to use or even know how to use: I am creating a windows application with mysql backend. 1....
4
by: =?Utf-8?B?MjJQb20=?= | last post by:
Hi All, This is all new to me so please be patient with me. What I have is a very large 'Al-In-One' program, not yet complete, that has over 70 Forms/Modules/Classes in it and needs to be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.