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?