先用自适应规避了
If e.Form.Width > 0 AndAlso e.Form.Height > 0 Then
e.Form.StopRedraw
For Each c As Winform.Control In e.Form.Controls
'msgbox(c.Gettype().Tostring() )
'msgbox(c.name)
Dim str() As String
str = c.Gettype().Tostring().split(".")
Dim strtmp As String
strtmp = str(str.Length -1)
Select Case strtmp
Case "Button","Lable","TreeView"
Case Else
c.Left = c.Left * (e.Form.Width / vars("width"))
c.Top = c.Top * (e.Form.Height / vars("height"))
c.Width = c.Width * (e.Form.Width / vars("width"))
c.Height = c.Height * (e.Form.Height / vars("height"))
End Select
Next
'msgbox(e.Form.Height / vars("height"))
vars("width") = e.Form.width
vars("height") = e.Form.height
e.Form.ResumeRedraw
End If