先在声明中加入

Dim myheight, mywidth As Integer

 

在窗体的LOAD事件中加入

mywidth = Me.Width

myheight = Me.Height

 

Resize事件中加入

Me.Height = myheight

Me.Width = mywidth