Event when a window gets maximized/un-maximized

前端 未结 10 904
失恋的感觉
失恋的感觉 2020-11-27 05:48

Is there an event that is fired when you maximize a Form or un-maximize it?

Before you say Resize or SizeChanged: Those get only fired if t

10条回答
  •  旧时难觅i
    2020-11-27 06:17

    ' Great tip. So if it helps to VisualBasic In Code
    Private Const WM_SYSCOMMAND As Integer = &H112
    Private Const SC_MAXIMIZE As Integer = &HF030
    ' # WndProcess 루프함수
    Protected Overrides Sub WndProc(ByRef m As Message)
        If m.Msg.Equals(WM_SYSCOMMAND) Then
            If (m.WParam.ToInt32.Equals(SC_MAXIMIZE)) Then
                Me.p_FullScreen()
                Return
            End If
        End If
    
        MyBase.WndProc(m)
    End Sub
    

提交回复
热议问题