VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

AutoResize version 2

Mark Parter  (2 Submissions)   Custom Controls/Forms/Menus   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

This code resizes a form and it's controls (and fonts) according to the users resolution.

Inputs
designwidth, designheight, designfontsize For example if you designed your app at 800x600 and Small Fonts then you would set the above variables to 800, 600, 96 (or 120 for Large fonts). Then just sit back and let the code do the rest. THIS CODE ALSO ALLOWS BASIC POSITIONING OF CONTROLS. For example L120 would add 120 pixels onto the left coordinate. T200 would add 200 pixels onto the top coordinate. W150 would add 150 pixels onto the width coordinate. H70 would add 70 pixels onto the height coordinate. To achieve this simply enter the letter followed by the amount in the controls 'Tag' property.

Side Effects
No custom controls are supported at the moment. If you need any help with this then e-mail me at: [email protected]

API Declarations
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Public Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Public Const LOGPIXELSX = 88
Public Const LOGPIXELSY = 90

Rate AutoResize version 2 (20(20 Vote))
AutoResize version 2.bas

AutoResize version 2 Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters