473,387 Members | 3,033 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,387 software developers and data experts.

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 2307
below is a excerpt from a static class i use , i believe u can use the
Screen class

Screen aScreens = Screeen.AllScreens // 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(Control oControl, NetTools.dvAlignMent
ePosition)

{

Screen[] aScreens = Screen.AllScreens;

Rectangle R = aScreens[0].Bounds;

int xPos = 0;

int yPos = 0;

if (ePosition == dvAlignMent.BottomRight)

{

oControl.Location = new Point(R.Width - oControl.Size.Width, R.Height -
oControl.Size.Height);

}

else if (ePosition == dvAlignMent.BottomLeft)

{

oControl.Location = new Point(0, R.Height - oControl.Size.Height);

}

else if (ePosition == dvAlignMent.BottomCenter)

{

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

oControl.Location = new Point(xPos, R.Height - oControl.Size.Height);

}

// top stuff

else if (ePosition == dvAlignMent.TopRight)

{

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

yPos = 0;

oControl.Location = new Point(xPos, yPos);

}

else if (ePosition == dvAlignMent.TopLeft)

{

xPos = 0;

yPos = 0;

oControl.Location = 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
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
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...
1
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...
3
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...
3
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...
0
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...
0
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...
1
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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,...

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.