468,309 Members | 1,087 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,309 developers. It's quick & easy.

Advice on detecting screen resolution and resizing application and its objects

I need to be able to detect different screen resolutions and then
resize my applications forms, objects, fonts etc, to suit.
Any ideas how to go about it?
I use VB 5.
Many thanks in advance.
Jul 17 '05 #1
6 8361
On Wed, 19 May 2004 22:00:02 +1000, dreamer wrote:
I need to be able to detect different screen resolutions and then
resize my applications forms, objects, fonts etc, to suit.
Any ideas how to go about it?
I use VB 5.
Many thanks in advance.


Screen.Width and Screen.Height tell you the resolution.

Private Sub Form_Load()
Me.Height = Screen.Height / 3 'or whatever number
Me.Width = Screen.Width / 3 'you want to use
End Sub

--
auric underscore underscore at hotmail dot com
*****
[blank stare]
Jul 17 '05 #2
Methinks you forgot to include the Screen.TwipsPerPixelX/Y in the demo. :-)
--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.

"In VB we had to code our own bugs. In dotnet we can inherit them."
"Auric__" <no*********@email.address> wrote in message
news:6d********************************@4ax.com...
: On Wed, 19 May 2004 22:00:02 +1000, dreamer wrote:
:
: >I need to be able to detect different screen resolutions and then
: >resize my applications forms, objects, fonts etc, to suit.
: >Any ideas how to go about it?
: >I use VB 5.
: >Many thanks in advance.
:
: Screen.Width and Screen.Height tell you the resolution.
:
: Private Sub Form_Load()
: Me.Height = Screen.Height / 3 'or whatever number
: Me.Width = Screen.Width / 3 'you want to use
: End Sub
:
: --
: auric underscore underscore at hotmail dot com
: *****
: [blank stare]

Jul 17 '05 #3
On Wed, 19 May 2004 21:57:04 GMT, Randy Birch wrote:
Methinks you forgot to include the Screen.TwipsPerPixelX/Y in the demo. :-)


I don't typically use them; I don't usually even bother resizing, I just
set the form at a fixed size. (I'm lazy and evil, I know.)
--
auric underscore underscore at hotmail dot com
*****
[blank stare]
Jul 17 '05 #4
On Wed, 19 May 2004 21:57:04 GMT, "Randy Birch"
<rg************@mvps.org> wrote:
Methinks you forgot to include the Screen.TwipsPerPixelX/Y in the demo. :-)

Hello Randy,
Could you please give more detail on the Screen.TwipsPerPixelX/Y that
you mention. A sample perhaps?
I am not real flash as a programmer (not even a programmer really) and
I sometimes struggle with the obvious.
Thanks.
Jul 17 '05 #5
Methinks you forgot to include the Screen.TwipsPerPixelX/Y in the
demo. :-) Hello Randy,
Could you please give more detail on the Screen.TwipsPerPixelX/Y that
you mention. A sample perhaps?
I am not real flash as a programmer (not even a programmer really) and
I sometimes struggle with the obvious.


PixelsWide = Screen.Width \ Screen.TwipsPerPixelX
PixelsHigh = Screen.Height \ Screen.TwipsPerPixelY

Rick - MVP

Jul 17 '05 #6
Jim
Your best bet is to use a third party resizer ocx. Sheridan use to
make one that worked well. Sheridan was purchased by Infragistics or
some such. Good luck.

Jim

dreamer <no****@nowhere.com.au> wrote in message news:<3h********************************@4ax.com>. ..
On Wed, 19 May 2004 21:57:04 GMT, "Randy Birch"
<rg************@mvps.org> wrote:
Methinks you forgot to include the Screen.TwipsPerPixelX/Y in the demo. :-)

Hello Randy,
Could you please give more detail on the Screen.TwipsPerPixelX/Y that
you mention. A sample perhaps?
I am not real flash as a programmer (not even a programmer really) and
I sometimes struggle with the obvious.
Thanks.

Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Erik Bethke | last post: by
4 posts views Thread by Ronny Sigo | last post: by
2 posts views Thread by Mustufa Baig | last post: by
4 posts views Thread by David | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.