Capturing Screen Width/Height information

V

Vantastic

I've been looking for information about this from all the usual haunts and
haven't found an answer.

I'm creating an application which is to be run by many users, who all use
different screen resolutions. I have designed in 1024x768 which is the
minimum I am allowing.

However, some people like the forms to fill up the screen as much as
possible, all of the forms I am resizing have code behind which resizes
controls and positions dynamically (the OnResize event), but rather than
having to have the user do this each time I'd like to 'suggest' a layout
initially...

I basically want to have a menu down the left hand side as a separate form,
and then everything else taps off its location, however height and width of
these child forms is undeterminable unless I know the total height/width of
the actual application window.

I feel I may have totally overlooked a small little command here but I'm at
a loss. Can anyone help?
 
D

Dennis

In a module put this decalre statement at the top
Declare Function GetSystemMetrics& Lib "User32" (ByVal nIndex&)

To get the screen size use a call like this

MsgBox "The Screen Width is " & GetSystemMetrics(0)
MsgBox "The Screen Height is " & GetSystemMetrics(1)
 

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