试试这个方法Dim resizeEA As EventArgs = NothingProtected Overrides Sub OnResize(ByVal e As EventArgs) If resizeEA Is Nothing Then resizeEA = e AddHandler Application.Idle, AddressOf OnIdle End If End SubPrivate Sub OnIdle(ByVal s As Object, ByVal e As EventArgs) If Not (resizeEA Is Nothing) Then MyBase.OnResize(resizeEA) resizeEA = Nothing RemoveHandler Application.Idle, AddressOf OnIdle End If End Sub
If resizeEA Is Nothing Then
resizeEA = e
AddHandler Application.Idle, AddressOf OnIdle
End If
End SubPrivate Sub OnIdle(ByVal s As Object, ByVal e As EventArgs)
If Not (resizeEA Is Nothing) Then
MyBase.OnResize(resizeEA)
resizeEA = Nothing
RemoveHandler Application.Idle, AddressOf OnIdle
End If
End Sub
Me.MaximumSize = My.Computer.Screen.WorkingArea.SizeWorkingArea是屏幕的可用区域
这是置窗口最前,跟我的问题有什么关系?
我要的是拖动扩大或缩小Windows工具栏时,自己的程序窗口能跟着缩放