473,503 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Working with multiple displays

I'm looking at developing an application which would benefit from being
able to work with 2 display monitors. But how do I work with multiple
displays? I'd like to be able to control which display a form opens
on, etc. Are there objects/APIs in .NET that support this? I've
trolled through the object browser, but haven't been able to find
anything. Either they aren't there, or I'm not looking for the right
words. Any advice welcomed.

May 30 '06 #1
3 3831
Hi Steve,

The System.Windows.Forms.Screen class has info about the available screens,
dimensions, etc.

So, if the computer is set to use extended desktop you will have 2 screens
and you can change the Location property of a form to position it beyond the
x-boundary (1024 typically) of the primary screen.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

"Steve Marshall" <st****@westnet.net.au> escribió en el mensaje
news:11**********************@j55g2000cwa.googlegr oups.com...
I'm looking at developing an application which would benefit from being
able to work with 2 display monitors. But how do I work with multiple
displays? I'd like to be able to control which display a form opens
on, etc. Are there objects/APIs in .NET that support this? I've
trolled through the object browser, but haven't been able to find
anything. Either they aren't there, or I'm not looking for the right
words. Any advice welcomed.

May 30 '06 #2
Many thanks Carlos. That should send me in the right direction.

May 30 '06 #3
Carlos J. Quintero [VB MVP] wrote:
Hi Steve,

The System.Windows.Forms.Screen class has info about the available screens,
dimensions, etc.

So, if the computer is set to use extended desktop you will have 2 screens
and you can change the Location property of a form to position it beyond the
x-boundary (1024 typically) of the primary screen.


As Carlos wrote, you use the Screen class to obtain info about the
available screens. eg -

Dim Scrn() as Screen = Screen.AllScreens
Dim ScrnCount As UInt16 = UBound(Scrn)

As I have 4 screens on my system, "ScrnCount" will return a value of 3.

A couple of traps to watch out for are -

1. Don't assume all screen resolutions to be the same. Some people have
multiple screens using multiple resolutions. Obtain specific screen
details using properties such as "Scrn(x).WorkingArea" etc.

2. The identity number of screens isn't always as you might think. For
example, my 4 screens are horizontally positioned from left to right on
my desk. No matter how many times I have changed the identity settings
to 0-1-2-3, for some reason XP eventually defaults back to 0-3-1-2 in
its identity sequence! (Windows Settings actually displays this as
1-4-2-3) So, if I try to position my Form by writing - "Me.Left =
Scrn(1).WorkingArea.X" the Form will display on the left-hand edge of
the 3rd screen along. Which is a nuisance if I'm trying to carry-over a
display that was shown on the 1st screen. I know of others who have
this same problem!

I hope this provides a bit more insight for you.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
May 30 '06 #4

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

Similar topics

4
5347
by: carl.barrett | last post by:
Hi, I have a list box that displays 2 columns. Behind it sits a query with five columns. These are Column1 (DOB), column2 (a concatenated string of Surname Forname, Title), Column3 (Surname),...
2
4652
by: James X. Li | last post by:
Is there a way to implement multiple login forms for ASP.NET applications? With our application we want to implement simple login form for normal resources (downloadable files), but more rigorous...
11
20871
by: Clark Stevens | last post by:
I just finished a WinForms app in VB.NET. I want to allow the user to be able to run multiple instances of the program like you can with Notepad and Wordpad. The way it is now, once I run the...
2
3044
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
8
1433
by: dynomite | last post by:
-if the Subtotal is equal to or less than 25000, multiply subtotal by 12%, if not set to 0 - If the Subtotal is greater than 25000 but less than or equal to 10000, multiply subtotal by 10%, if not...
1
3069
by: sheenaa | last post by:
Hello friends, I m using ASP.NET with C# 2005 and SQL SERVER 2005 for the ASP.Net Website. I m using sqldatasource to connect and retrieve the data from database and then it displays the data...
0
3089
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
2
6922
by: 6afraidbecause789 | last post by:
Hi - Has anyone ever used toggle buttons to select items in a listbox? I'd like to put about 24 toggle buttons on an unbound form that select or deselect items in a multiple select listbox. I've...
6
2495
by: Zetten | last post by:
This is going to be a long one, but hopefully that will make it easier to understand. I know I don't like posts with too little detail when I'm searching for help. I am creating a form with which...
0
7205
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
7093
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
7287
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,...
1
7008
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
7467
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
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.