Way to detect screen resolution?

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)
 
H

Herfried K. Wagner [MVP]

* "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>
 
K

Ken Tucker [MVP]

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
 
W

What-a-Tool

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top