Form window state with keyboard button

By afp_romania on Dec 02, 2012

This code will make your form normal from a maximised state.
Picturebox represent the maximise button and e.keys11 will make normal state on the desktop.

    Private Sub PictureBox7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub WebBrowser1_PreviewKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles WebBrowser1.PreviewKeyDown
        If e.KeyCode.Equals(Keys.F11) Then
            Me.WindowState = FormWindowState.Normal
        End If
    End Sub

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.