我知道这是一个旧的帖子,但也许有人在寻找答案时会发现这个。
您可以创建自己的自定义事件来完全实现您想要的功能。
声明事件:
Public Event Maximized(sender As Object, e As EventArgs)
触发自定义事件:
Private Sub frmMain_ResizeEnd(sender As Object, e As EventArgs) Handles Me.ResizeEnd
If Me.WindowState = FormWindowState.Maximized Then RaiseEvent Maximized(sender, Nothing)
End Sub
处理您的自定义事件:
Private Sub frmMain_Maximized(sender As Object, e As EventArgs) Handles Me.Maximized
End Sub
或者
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AddHandler Me.Maximized, AddressOf MaximizedEventMethod
End Sub
Private Sub MaximizedEventMethod(sender As Object, e As EventArgs)
'add your code here
End Sub