Screen resolution w/ 2 monitors

  • Thread starter Thread starter Darin
  • Start date Start date
D

Darin

In my program I save the position of the form so the next time the user
logs in and gets to that form it is in the same place. This works great.
But I have run into an issue. Some users have 2 monitors so they slid
the form to the second window. The next time they get to that form it is
in the second monitor (perfect). But, if they were to run the software
from a single monitor machine and get to that form, the form is not
displayed on the monitor because it is wanting to put it on the second
monitor.

What code can I run to see what the resolution of the monitor is, and
how does that resolution handle multiple monitors. In this case, since
this machine only has 1 monitor I want the form to be displayed in the
center for the only monitor and not even try to put it on the
non-existant second monitor.

Thanks.

Darin
 
Darin said:
In my program I save the position of the form so the next time the
user logs in and gets to that form it is in the same place. This
works great. But I have run into an issue. Some users have 2 monitors
so they slid the form to the second window. The next time they get to
that form it is in the second monitor (perfect). But, if they were to
run the software from a single monitor machine and get to that form,
the form is not displayed on the monitor because it is wanting to put
it on the second monitor.

What code can I run to see what the resolution of the monitor is, and
how does that resolution handle multiple monitors. In this case, since
this machine only has 1 monitor I want the form to be displayed in the
center for the only monitor and not even try to put it on the
non-existant second monitor.

See System.SystemInformation

I suppose you'd compare PrimaryMonitorSize, VirtualScreen and the intended
location of your form.

Andrew
 
Back
Top