473,804 Members | 2,272 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 3866
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.goo glegroups.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.AllScree ns
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).Workin gArea" 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).Working Area.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
5372
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), column4 (Forename) and column5 (title). Columns 3,4 and 5 are not shown in the list box only the first two. DOB Name: &" "&&", "&
2
4664
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 login forms for tasks like administration and configuration. The current ASP.NET seems only to allow to a single login form via the authentication element in web.config in the root directory. One work-around for our problem is implementing a...
11
21011
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 executable I can not run another instance as long as the first instance is running. How can I change this behavior? Thanks.
2
3075
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 displays data dependent on what has been typed in. After having trouble with populating my second combo box (I eventually populated it by putting the fields for both combo boxes in 1 separate query) I am now having problems with the 3rd one and am...
8
1446
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 set to 0 - f the Subtotal is greater than 10000, multiply subtotal by 7%, if not set to 0 Total=Subtotal+(one of the values above) Can anyone help, i must be writing the expressions incorrectly????
1
3086
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 in the gridview on the button click event.I have created the stored procedure for insert and select query. Now in my application i have used checkboxlist where there can be multiple selection for the hobbies. I want to know how can i store the...
0
3126
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td colspan="2"><p>
2
6952
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 come across a way to set the listbox value to only 1 at a time, but need multiple toggle buttons to be on their corresponding listbox item values to be selected. Thanks!
6
2515
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 a user can make forms. After filling in basic details like Title, Author, Description, the user can add multiple input fields of different types. This is done in the form of a table, with each row acting for a single input, i.e. input1, input2,...
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10599
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10346
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7635
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.