Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen Scaling...

Status
Not open for further replies.

bluenoser337

Programmer
Jan 31, 2002
343
0
0
CA
I have an application with forms that have graphics, text boxes, and a bit of everything on them. It was created for 800 x 600 screen resolution. It must now be used on 1024 x 768 and of course all the windows are too small now. What can I change in the form properties that will re-size everything correctly? Thanks!!
 
Here is a piece of code that I use to adjust my form when
some one resizes it with the border. The same idea could be used for your situation
=================================================
Private Sub Form_Resize()
On Error Resume Next
Dim XCoeff As Single
Dim YCoeff As Single
Dim Controle As Control

XCoeff = Width / OldWidth ' must be saved before resize like in form_load

YCoeff = Height / OldHeight ' same for height
For Each Controle In Me
Controle.Move Controle.Left * XCoeff, Controle.Top * YCoeff, Controle.Width * XCoeff, _ Controle.Height * YCoeff
Next
OldWidth = Width ' Save for next call
OldHeight = Height
End Sub

=================================================

André
 
Beware that some controls doesn't allow to change height (like, combobox).
And probably you can increase fonts as well.

See also:
thread222-526093
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top