Multiple monitors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Huish

    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
  • daveL

    #2
    Re: Multiple monitors

    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" <huish@ozemail. com.auwrote in message
    news:MPG.22ad08 f8549d70589896f 3@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

    Comment

    Working...