473,394 Members | 1,700 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,394 software developers and data experts.

Selecting which monitor a form is displayed on

Does anyone know how to select the monitor that a form will be
displayed on at runtime? I would like to be able to display a list in
a form on the first monitor and a list of detailed reports in the
other. Does anyone know how to do this?

Thanks,
Wayne

Jan 16 '07 #1
3 3979
Hi Wayne,

There is a Screen class that can help you with this. It has properties
like PrimaryScreen, AllScreens, WorkingSize and so on that you can use to
determine how many screens, which is the primary and their sizes etc.

On Wed, 17 Jan 2007 00:40:56 +0100, wayne <wa***@pacsaware.comwrote:
Does anyone know how to select the monitor that a form will be
displayed on at runtime? I would like to be able to display a list in
a form on the first monitor and a list of detailed reports in the
other. Does anyone know how to do this?

Thanks,
Wayne


--
Happy Coding!
Morten Wennevik [C# MVP]
Jan 17 '07 #2
Example (from another kind soul who helped me with a similar problem):

To open a form on the DEFAULT monitor which is also centered to the
screen:

<code>

private void Form1_Load(object sender, EventArgs e)
{
Rectangle wa = Screen.PrimaryScreen.WorkingArea;
Location = new Point(((wa.Width - Width)/2) + wa.X,
((wa.Height - Width)/2) + wa.Y);
}

</code>

Jan 17 '07 #3
Thanks this works for me.

Wayne

Code Monkey wrote:
Example (from another kind soul who helped me with a similar problem):

To open a form on the DEFAULT monitor which is also centered to the
screen:

<code>

private void Form1_Load(object sender, EventArgs e)
{
Rectangle wa = Screen.PrimaryScreen.WorkingArea;
Location = new Point(((wa.Width - Width)/2) + wa.X,
((wa.Height - Width)/2) + wa.Y);
}

</code>
Jan 17 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bathroom_Monkey | last post by:
Hi, I am building some php script that will backup a mysql database and store it locally. This script will be run on a spare computer I have in my office. I want the results of the backup to be...
10
by: KJM | last post by:
How can I detect if the user has dual monitors and then how do I control which monitor a form is displayed on. Currently my forms always come up on my right monitor. What if I want to have it...
4
by: Sami | last post by:
I hope someone will tell me how to do this without having to do any VB as I know nothing in that area. I am a rank beginner in using Access. I have created a database consisting of student...
2
by: Armin | last post by:
Hello I want get the Screen Coordinates of a Control. I do this with Control.PointToScreen. vlob_Point = Me.PointToScreen(New System.Drawing.Point(0, 0)) This works fine with a Single...
2
by: Lance | last post by:
I need to monitor the status of the mouse on an application-wide basis (i.e., not just for the control that owns the mouse). One I idea I had was to create a shared class that inherits from timer...
1
by: Al Reid | last post by:
I have an application where a 3rd party viewer is displayed next to a VB2005 app. I was told that the viewer needs to occupy the left 2/3 of the screen and the app the right 1/3. Is there...
10
by: RobinS | last post by:
Hello to all, and happy new year! I have this application that someone wrote that I'm sort of checking out. The forms look fine in design mode, but when I run the application, it crops off the...
0
by: Satiz | last post by:
Hi All, I've a TreeView(IE Webcontrol) and a DataGrid in my VS.Net 2003 ASP.Net web form. My problem : If i select a particular node(it may be parent, child or leaf), then the corresponding...
0
by: praveenhathwar | last post by:
I ve developed an application. My client has two monitors for a single PC. He wants to display a video clip in the second monitor continuosly (Repeatedly) and when the application in runs in Primay...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.