Click to See Complete Forum and Search --> : Setting automaticly the form and controls size


trasher
August 20th, 2001, 04:22 PM
I want to know if it's possible to set automaticly the size of forms and controls for a specific screen size or resolution...
Because I have a program know that contains forms wich can be easily viewed on a 17'' screen. But it has to be seen also on a 14'' screen...
Do someone have an idea ??

Make it with rocker style \w/

venkytvs
August 21st, 2001, 05:19 AM
U can use this Active-x control developed by Sudhir Rakode...

http://www.planet-source-code.com/xq/ASP/txtCodeId.2618/lngWId.1/qx/vb/scripts/ShowCode.htm

-Venky
Rate it if u like it...

Iouri
August 21st, 2001, 06:53 AM
The following is a simple code that you can use to make a form designed in 800x600 mode uniform over all
resolutions.



private Sub Form_Load()
on error resume next
Dim CtrlVar as Control
Xratio = Screen.Width / (Screen.TwipsPerPixelX * 800)
Yratio = Screen.Height / (Screen.TwipsPerPixelY * 600)
for Each CtrlVar In FrmVar.Controls
CtrlVar.Left = CtrlVar.Left * Xratio
CtrlVar.Top = CtrlVar.Top * Yratio
CtrlVar.Width = CtrlVar.Width * Xratio
CtrlVar.Height = CtrlVar.Height * Yratio
CtrlVar.Font.Size = CtrlVar.Font.Size * XRatio
next CtrlVar
End Sub



Iouri Boutchkine
iouri@hotsheet.com

trasher
August 21st, 2001, 07:22 AM
I used the .ocx but it don't seems to work too much...
I designed my forms in 1154 X 864
But I don't see it much in 800 X 600

I tried Iouri's code also. But it did'nt worked neither.

Make it with rocker style \w/