To provide resolution indendepence forms through Mathematical(always provides good results!!) Calcu
To provide resolution indendepence forms through Mathematical(always provides good results!!) Calculations to the forms. I've tried this is
API Declarations
'For Resolution Settings
Private Declare Function GetSystemMetrics Lib "user32" (ByVal Index As Long) As Long
''
Rate To provide resolution indendepence forms through Mathematical(always provides good results!!) Calcu
(2(2 Vote))
'Decl for resolution indenpendent forms
Dim mDblPerincr As Double
Dim lngresX As Long, lngresY As Long
''
' Code for setting the Form Resolution Independant
' The below code Fetches the resolution of the current form and
' ** It calculates the % of increase or decrease in size of the form comparing with the 800 X 600 resolution
' ** After equating the formula it gives a % value of increase in size
' ** The % value is used to increase or decrease the size of the objects in the form
Public Function resolution(myform As Form)
'Decl for resolution indenpendent forms
Dim mDblPerincr As Double
Dim lngresX As Long, lngresY As Long
lngresX = GetSystemMetrics(0)
lngresY = GetSystemMetrics(1)
mDblPerincr = lngresX / 800
For Each Control In myform
With Control
.Width = .Width * mDblPerincr
.Height = .Height * mDblPerincr
.Left = .Left * mDblPerincr
.Top = .Top * mDblPerincr
.FontSize = .FontSize * mDblPerincr
End With
Next
End Function
'Now call the function which inturn takes all the objects placed inside ur form
Private Sub Form_Load()
Call resolution(Me)
End Sub
To provide resolution indendepence forms through Mathematical(always provides good results!!) Calcu Comments
No comments yet — be the first to post one!
Post a Comment