Add a module.bas :<br>
<br>
'Resize routines<br>
'Eric De Decker<br>
'Secretaris VBG België<br>
' <A HREF="mailto:vbg.be@vbgroup.nl">vbg.be@vbgroup.nl</A><br>
<br>
Option Explicit<br>
Public Xtwips As Integer, Ytwips As Integer<br>
Public Xpixels As Integer, Ypixels As Integer<br>
<br>
Type FRMSIZE<br>
Height As Long<br>
Width As Long<br>
End Type<br>
<br>
Public Positie_Form As Boolean<br>
Public NuResize As Boolean<br>
Dim DesignX As Integer<br>
Dim DesignY As Integer<br>
Dim ScaleFactorX As Single, ScaleFactorY As Single<br>
Dim MyForm As FRMSIZE<br>
<br>
A routine (procedure to the module ) :<br>
<br>
Public Sub FormResize(TheForm As Form)<br>
Dim ScaleFactorX As Single, ScaleFactorY As Single<br>
If Not NuResize Then<br>
NuResize = True<br>
Exit Sub<br>
End If<br>
Positie_Form = False<br>
ScaleFactorX = TheForm.Width / MyForm.Width<br>
ScaleFactorY = TheForm.Height / MyForm.Height<br>
Resize_Resolutie ScaleFactorX, ScaleFactorY, TheForm<br>
MyForm.Height = TheForm.Height<br>
MyForm.Width = TheForm.Width<br>
End Sub<br>
<br>
a other procedure :<br>
<br>
Sub Resize_Resolutie(ByVal SFX As Single, ByVal SFY As Single, MyForm As Form)<br>
Dim I As Integer<br>
Dim SFFont As Single<br>
SFFont = (SFX + SFY) / 2<br>
On Error Resume Next<br>
With MyForm<br>
For I = 0 To .Count - 1<br>
If TypeOf .Controls(I) Is ComboBox Then<br>
.Controls(I).Left = .Controls(I).Left * SFX<br>
.Controls(I).Top = .Controls(I).Top * SFY<br>
.Controls(I).Width = .Controls(I).Width * SFX<br>
Else<br>
.Controls(I).Move .Controls(I).Left * SFX, _<br>
.Controls(I).Top * SFY, _<br>
.Controls(I).Width * SFX, _<br>
.Controls(I).Height * SFY<br>
<br>
End If<br>
If TypeOf .Controls(I) Is DBGrid Then<br>
<br>
Else<br>
<br>
.Controls(I).FontSize = .Controls(I).FontSize * SFFont<br>
End If<br>
Next I<br>
<br>
If Positie_Form Then<br>
<br>
.Move .Left * SFX, .Top * SFY, .Width * SFX, .Height * SFY<br>
<br>
End If<br>
End With<br>
<br>
<br>
End Sub<br>
<br>
Next procedure :<br>
<br>
Public Sub SizeForm(TheForm As Form)<br>
Dim Resolut As String<br>
DesignX = 1024<br>
DesignY = 768<br>
Positie_Form = True<br>
NuResize = False<br>
Xtwips = Screen.TwipsPerPixelX<br>
Ytwips = Screen.TwipsPerPixelY<br>
Ypixels = Screen.Height / Ytwips<br>
Xpixels = Screen.Width / Xtwips<br>
ScaleFactorX = (Xpixels / DesignX)<br>
ScaleFactorY = (Ypixels / DesignY)<br>
TheForm.ScaleMode = 1<br>
Resize_Resolutie ScaleFactorX, ScaleFactorY, TheForm<br>
Resolut = Str$(Xpixels) + " by " + Str$(Ypixels)<br>
MyForm.Height = TheForm.Height<br>
MyForm.Width = TheForm.Width<br>
<br>
End Sub<br>
<br>
The Form :<br>
<br>
Private Sub Form_Load()<br>
Call SizeForm(Me)<br>
End Sub<br>
<br>
Private Sub Form_Resize()<br>
<br>
Call FormResize(Me)<br>
<br>
End Sub<br>
<br>
From Eric De Decker<br>
<br>
<A HREF="mailto:vbg.be@vbgroup.nl">vbg.be@vbgroup.nl</A><br>
<br>