Way to detect screen resolution?

  • Thread starter Thread starter What-a-Tool
  • Start date Start date
W

What-a-Tool

I recently created an application on my 19" monitor - looked good.
Tried running it on a 17 inch monitor - didn't look so good anymore.
Is there a way that monitor resolution/screen size can be detected, so that
I could keep my controls and form displayed and centered without resorting
to scroll bars?
Same problem with running a form Maximised or minimised.
Is there a way to detect if a form is in it's maximised or minimised state,
and it's current size, so that controls can be centered?



--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
 
* "What-a-Tool said:
I recently created an application on my 19" monitor - looked good.
Tried running it on a 17 inch monitor - didn't look so good anymore.
Is there a way that monitor resolution/screen size can be detected, so that
I could keep my controls and form displayed and centered without resorting
to scroll bars?
Same problem with running a form Maximised or minimised.

'SystemInformation.PrimaryMonitorSize'
'SystemInformation.WorkingArea'
'SystemInformation.VirtualScreen'
'Screen.PrimaryScreen.Bounds'
'Screen.PrimaryScreen.WorkingArea'

When using multiple monitors:

'Screen.AllScreens'
Is there a way to detect if a form is in it's maximised or minimised state,
and it's current size, so that controls can be centered?

Check the form's 'WindowState' property in its 'Resize' event.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Hi,

The SystemInformation.PrimaryMonitorSize will tell you the screen
size in pixels. The forms windowstate property will tell you if the form is
minimized, maximized, or normal.

Ken
 
Thanks - You guys are the best -

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
 
Back
Top