下面的代码你试试。
Option Compare Database
Dim FrmW As Single '存放改变前的窗体的宽度
Dim frmH As Single '存放改变前的窗体的高度
Private Sub Form_Load()
'If me.windowstate <> vbMinimized Then
FrmW = Me.InsideWidth
frmH = Me.InsideHeight
'上面两句是初始化模块变量
'Form_Resize1
'End If
End Sub
Private Sub Form_Resize()
If FrmW = 0 Or frmH = 0 Then Exit Sub
On Error Resume Next
Dim MyCon As Control
Dim sig1 As Single, sig2 As Single
sig1 = Me.InsideWidth / FrmW
sig2 = Me.InsideHeight / frmH
For Each MyCon In Me.Controls
With MyCon
If .ControlType = 109 Or .ControlType = 100 Or .ControlType = 112 Or .ControlType = 119 Then
.Left = Int(.Left * sig1)
.Top = Int(.Top * sig2)
.Width = Int(.Width * sig1)
.Height = Int(.Height * sig2)
End If
End With
Next MyCon
FrmW = Me.InsideWidth
frmH = Me.InsideHeight
End Sub