|
-
Aug 25th, 2000, 05:25 PM
#1
Thread Starter
Addicted Member
Could someone please tell me how to change the screen resolution at run-time. I am writing an application, and I would prefer it if it could automatically put the screen into 800x600 mode. My forms look better in 800x600! (I drew everything in 800x600 mode.)
Alternatively, I have experimented with sizing routines. These just read the resolution and redraw everything to look right at any setting. I get the current screen setting, and redraw all controls as follows:
Private Sub Form_Load()
Dim X as control
Me.Width = Me.Width * (CurrentPixelsX/800)
Me.Height = Me.Height * (CurrentPixelsY/600)
For Each X In Me.Controls
X.Width = X.Width * (CurrentPixelsX/800)
X.Height = X.Height * (CurrentPixelsY/600)
X.Left = Me.Left * (CurrentPixelsX/800)
X.Top = Me.Top * (CurrentPixelsY/600)
Next X
(CurrentPixelsX and CurrentPixelY are variables that hold the current screen resolution. I can get these values without difficulty.) This works fine - just need to watch out for timers and things which can't be moved/resized at run-time. Easy to find with an extra line:
If Typeof X Is Timer = False Then
{Resize commands}
EndIf
So why doesn't my new method work? It doesn't re-size pictures that have been used on command buttons! The resized buttons look really odd!
So, if anyone could tell me either:
How to change the screen resolution at run-time
Or
How to make command button pictures resize with the button
I'd be most grateful. (I'd prefer the first option!)
Thanks very much,
Steve.
P.S. How do I include actual VB code in these threads?
Sent by: Steve Barker
E-mail: [email protected]
P.S. I KNOW 1 is not a prime!
See this thread: http://forums.vb-world.net/showthread.php?threadid=26485
-
Aug 25th, 2000, 06:35 PM
#2
Frenzied Member
code brackets [ code ] and to end it [ /code ] just without spaces.
Compare your code to this, maybe that will help.
http://www.vb-world.net/graphics/tip67.html
-
Aug 26th, 2000, 04:26 AM
#3
Thread Starter
Addicted Member
Thanks for the link SteveCRM!
I don't understand your code brackets though!
Cheers,
Steve.
Sent by: Steve Barker
E-mail: [email protected]
P.S. I KNOW 1 is not a prime!
See this thread: http://forums.vb-world.net/showthread.php?threadid=26485
-
Aug 26th, 2000, 04:29 AM
#4
Fanatic Member
In posts, you should put code in code brackets.
=
[ code ]
some code
[ /code ]
(remove the spaces)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|