不锈钢折弯加工厂:VB中如何即时获得窗口大小信息

来源:百度文库 编辑:神马品牌网 时间:2024/05/03 00:27:58
例如在用鼠标改变窗体大小后,马上通过Text1.Text或其他获得改变后窗口的长宽,谢谢!

在窗体的Resize事件里获得长宽属性:
Private Sub Form_Resize()
Text1.Text = "width=" & Form1.Width & ",height=" & Form1.Height
End Sub

form_resize事件里加上
Text1.Text=me.width
Text2.Text=me.height

Private Sub Form_Resize()
Label1.Caption = Str(Form1.Height) & Str(Form1.Width)
End Sub