Hi,
I have
vb program where the screens are disigned to fit screen resolution 1024 * 768. However, I need to fit these screens in to 800 * 600 as well. For this I used the following code ----
However, the font sizes and datacombos does not seems to change size.
(The form size changes accordingly, but in a messy way)
Can any one help me on this ??????
Thanks
Sam
Public Function resolution(myform As Form)
'Decl for resolution indenpendent forms
Dim mDblPerincr As Double
Dim lngresX As Long, lngresY As Long
On Error GoTo TrapErr
lngresX = GetSystemMetrics(0)
lngresY = GetSystemMetrics(1)
mDblPerincr = lngresX / 1024
FontSize = FontSize * mDblPerincr
myform.FontSize = myform.FontSize * mDblPerincr
myform.width = myform.width * mDblPerincr
myform.height = myform.height * mDblPerincr
myform.Left = myform.Left * mDblPerincr
myform.Top = myform.Top * mDblPerincr
For Each Control In myform
With Control
.FontSize = .FontSize * mDblPerincr
.width = .width * mDblPerincr
.height = .height * mDblPerincr
.Left = .Left * mDblPerincr
.Top = .Top * mDblPerincr
.ButtonHeight = .ButtonHeight * mDblPerincr
.ButtonWidth = .ButtonWidth * mDblPerincr
End With
Next
Exit Function
TrapErr:
Resume Next
End Function