|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Working with multiple displaysI'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. 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. -- Show quoteHide quoteBest 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" <ste***@westnet.net.au> escribió en el mensaje news:1148961324.429233.191370@j55g2000cwa.googlegroups.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. > Carlos J. Quintero [VB MVP] wrote:
> Hi Steve, As Carlos wrote, you use the Screen class to obtain info about the > > 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. > 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.
Check if an object is treatable as string/char
Common VB nomenclature Thread issue ?? referencing cells in Excel and finding empty cells Data in datagridview from a text file create registry value - bug in VS? Access to Access Database Need I internet programming with Socket? Result of a query into a variable in VB.NET MSCOMM in VS2005 |
|||||||||||||||||||||||