473,616 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple monitors


My application runs on a system that has 2 monitors. Currently if I
display a dialog box it will display on the monitor that currently has
focus. Is there a mechanism to have the dialog display on the monitor
that the main form of the application displayed on?

thanks

pete
Jun 1 '08 #1
1 2332
below is a excerpt from a static class i use , i believe u can use the
Screen class

Screen aScreens = Screeen.AllScre ens // a collection of all monitors
configured on ur computer

// so you should be able to do what you need

hope this helps

Dave

public static void MoveForm(Contro l oControl, NetTools.dvAlig nMent
ePosition)

{

Screen[] aScreens = Screen.AllScree ns;

Rectangle R = aScreens[0].Bounds;

int xPos = 0;

int yPos = 0;

if (ePosition == dvAlignMent.Bot tomRight)

{

oControl.Locati on = new Point(R.Width - oControl.Size.W idth, R.Height -
oControl.Size.H eight);

}

else if (ePosition == dvAlignMent.Bot tomLeft)

{

oControl.Locati on = new Point(0, R.Height - oControl.Size.H eight);

}

else if (ePosition == dvAlignMent.Bot tomCenter)

{

xPos = (R.Width / 2 - oControl.Width / 2);

oControl.Locati on = new Point(xPos, R.Height - oControl.Size.H eight);

}

// top stuff

else if (ePosition == dvAlignMent.Top Right)

{

xPos = R.Width - oControl.Width; //R.Height;

yPos = 0;

oControl.Locati on = new Point(xPos, yPos);

}

else if (ePosition == dvAlignMent.Top Left)

{

xPos = 0;

yPos = 0;

oControl.Locati on = new Point(xPos, yPos);

}

"Peter Huish" <hu***@ozemail. com.auwrote in message
news:MP******** *************** *@news.easynews .com...
>
My application runs on a system that has 2 monitors. Currently if I
display a dialog box it will display on the monitor that currently has
focus. Is there a mechanism to have the dialog display on the monitor
that the main form of the application displayed on?

thanks

pete

Jun 1 '08 #2

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

Similar topics

0
1469
by: Fred Moses | last post by:
Windows GDI has support for multiple display monitors. How do I gain access to comparable facilities in the .NET Foundation Class Library from C#?
1
11774
by: JMM | last post by:
I'm writing a control program that will require a lot of screen real estate to interact with the user. One thought I had on how to do this was to use a dual output display adapter and two monitors. I would then create forms that would present specific information on each monitor. My question is how to control which of the two monitors the form is drawn on?
1
1826
by: Jordan Wright | last post by:
Not sure if this is simple or hard, but I will simplify what I am trying to do. I want to display images on two different monitors. One fullscreen on the 2nd monitor, and one not fullscreen on the first monitor. How would I go about doing this? Using the screen class somehow?
3
4733
by: Lizim | last post by:
Does anybody know if it is possible to write software that works across multiple monitors? and if so, is it possible to program one so it is private to the user / administrator and the other public. i.e they both show different things. Or even better- the private one shows both screens and the public one shows just what is meant to be seen. If anybody could point me in the right direction of where to find out this info I would be very...
3
2112
by: Steve | last post by:
Hello-- I have made a C# executable that monitors the server it is placed on. This works great so far. Since I don't have physical access to this machine, I have my executable launched by task manager and it runs in the background. Its owner is SYSTEM, so that when I log out of terminal services, the application is still running.
0
2100
by: Ian Rutherford | last post by:
I'm currently trying to do something with VB .net that I'm having a lot of difficulty with. Basically, I need to be able to display a form on any monitor I choose. So, I have to enumerate all monitors available on the system (will be 3-4 monitors), choose a monitor, and display a form in full-screen mode on that monitor. The end result may be three monitors showing three full-size forms (one each), as well as one last monitor showing the...
0
1600
by: Brian | last post by:
I have an small graphical app in c# where a main form controls the graphical data on two other forms depending on input data. I am looking for a way to direct these two controlled forms to be displayed on a second and third display. I have used the Screen class to read the names/properties etc. of attached monitors but can not find how to direct the forms onto those monitors as well as a method to go to full screen or even just maximize...
1
2889
by: jaiello | last post by:
We have writen a script for a user confirmation reboot of the machine. Our computers have 3 monitors and we would like the popup box to display on all three monitors to make sure the user sees it as they may be working on any of the three monitors at the time of Prompting. Does anyone have any idea how to make the popup box display on all 3 monitors? thanks, J
1
153
by: Peter Huish | last post by:
My application runs on a system that has 2 monitors. Currently if I display a dialog box it will display on the monitor that currently has focus. Is there a mechanism to have the dialog display on the monitor that the main form of the application displayed on? thanks pete
0
8146
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
8647
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
8592
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...
0
8449
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5550
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4063
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
4141
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2579
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1445
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.