473,399 Members | 3,302 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,399 software developers and data experts.

Form Location on single/dual monitors

I have wizard kind of windows application with many forms. I have set the form Location this.Location = new Point(100, 100);
This works fine with single monitor. If the user connects to multiple monitors i want the form to be displayed in both the monitors. How can set the form Location? Also also if the user switches back to single monitor the Form should display in one monitor?
Feb 29 '08 #1
6 2542
dip_developer
648 Expert 512MB
I have wizard kind of windows application with many forms. I have set the form Location this.Location = new Point(100, 100);
This works fine with single monitor. If the user connects to multiple monitors i want the form to be displayed in both the monitors. How can set the form Location? Also also if the user switches back to single monitor the Form should display in one monitor?
I didnt understand your query....please clearly state your problem....
Feb 29 '08 #2
Shashi Sadasivan
1,435 Expert 1GB
Use the Screens.AllScreens to get a Screen array.

if the number of screens are more than one, then with Scheen.Primary you willg et to know if it is the main / primary screen.

To set the location of the form to any particular screen use the
myForm.Location = screen.WorkingArea.Location; //which is the 0,0 for that screen

you might have to manually check the number of screens and then decide accordingly. Unless i am missing something. I implemented a 4 screen application, and had to make sure that it would run for 1 to 4 screens, and hence had 4 cases, might look for a way to reducce that code
Feb 29 '08 #3
Thanks for your answer,
My requirement is to display the same Form in both the monitors. It should occupy both the monitors (half of the form in one monitor and other half in the 2nd monitor) Is it possible?
Feb 29 '08 #4
Shashi Sadasivan
1,435 Expert 1GB
You may want to iterate through all the screens, and compare which has the least point (ie, screen location)
and use that for the location of form.
and then find the max position of the right hand corner, and then you would have to give the size to the form.

however the form should not be maximized as it would revert itself to the bounds of only one screen.

Good luck with that
Feb 29 '08 #5
Thank you for your suggestions but i still cant get this working.
My form size is fixed. I dont want to change the Form size. I just need to change the Form Location.
For one monitor i set the Form location as this.Location = new Point(100, 100);
how can get the location in case of 2 monitors.
Feb 29 '08 #6
Plater
7,872 Expert 4TB
Why would you want it to start out split like that? Seems like it would be very obnoxious to have a big plastic bar or two (and possibly some air) between the form.
You will have to do some deciphering to discover which orientaion the monitors are in, (They don't have to be linked left-right, they could top-bottom) then determine the master viewable area dimensions and computer where the center point is. Then compute the offset of the center point in your form to the top-left corner of your form and apply that offset to the center of the viewable area and set your form there.


As an alternative, you could try one of the windows standard locations of "center"
Feb 29 '08 #7

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

Similar topics

2
by: Strah | last post by:
Is there a way to determine whether a computer is connected to dual monitors with VB.NET code? Thanks, Strah
3
by: fournij | last post by:
Hi I'm writing a MFC C++ application using Visual .NET. I'm using a Dual Head video card with 2 monitors. I want to start my application in the first monitor but open a dialog box in the...
0
by: Neji | last post by:
Is there a way to make a keyboard shortcut to change the mouse focus between dual monitors? For example, if I'm on the left-hand screen, would be able to hit a button combination that would change...
0
by: Neji | last post by:
Is it possible to switch between dual monitors with the keyboard? For example, if I am on the left-hand monitor, can I press a keyboard combination to teleport the mouse cursor to the middle of...
8
by: Sheldon | last post by:
I just received a 2nd (configured as a dual) monitor but, for Access only, I can't seem to figure out, if it's possible, to view, say, Table1 on one monitor and Table2 on the other monitor. If I...
7
by: Lyn | last post by:
Is there a solution to this problem? While stepping through code (F8) it would sometimes be helpful to observe changes occurring on the affected form in the Access window. However, the current...
3
by: Boki | last post by:
Hi All, I saw the paint.net program, when mouse hover, the color palette become 100% opacity. I try the code below, the issue is I also have some other controls ( textbox/button ) in my form,...
2
by: Cindy | last post by:
I've been using dual monitors for about a year now (absolutely love it), but have run into a weird situation with Access 2000 lately. I loaded a database on two PC's that do NOT have dual...
0
amitpatel66
by: amitpatel66 | last post by:
All, Please find below POST about Oracle SINGLE ROW FUNCTIONS which might be useful. SINGLE ROW FUNCTION are those which are executed once for each and every row of the Query. The different...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.