VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

AutoResize

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

This code resizes a form and its controls according to the screen resolution. It also takes into account the size of the screen fonts (although this is untested!).

Inputs
designwidth - the width that your app was designed at (i.e. 800 or 1024) designheight - the height that your app was designed at (i.e. 600 or 768) designfontsize - the size of the screen fonts (small - 96, large - 120)

Assumes
The function to resize depending upon the size of the fonts is untested as yet because my PC keeps crashing if I change the font size. If I doesn't work then could you let me know.

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

Rate AutoResize (7(7 Vote))
AutoResize.bas

AutoResize Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters