Click to See Complete Forum and Search --> : Screen Resolution


ankur26
March 12th, 2001, 04:24 AM
Is there any ocx or any one can give me sample code uising which my form will remain unaffected even if the screen resolution is increased or decreased ?

Thanks,
Ankur-ankur26@usa.net

vchapran
March 12th, 2001, 12:28 PM
Sheridan Resize control is pretending to do that, but does it not so good. Actually, if your form contains intrinsic Combo Box, it can be a problem with all resizers, because there is no way to change the height of Combo (only by changing its font, which is not flexible enough). Try to play with Sheridan (www.shersoft.com), they give fully functional trial version.
Vlad

Roy Kalin
March 12th, 2001, 07:58 PM
I've had some success using code from the Access97 Developer's Handbook (3rd edition, Sybex)Chapter 8 - "Screen Resolution and distributing forms". The code uses API calls and of course needs to be altered for use with VB vs. Access. Mainly most of the references to portions of an Access form have to be removed.

Best Regards, Roy Kalin

CK Dixon
March 13th, 2001, 06:08 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