Hi,
This is my first post here.
This is my problem.
I am making a drawing application . One of its functionality is to switch to full screen mode when the key "f" is pressed and back to its normal position when the key "esc" is pressed.
Right now Iam keeping the code to do this in a button
-------------------------------------------------------
Private Sub Button1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button1.KeyUp
If e.KeyCode = 70 Then
Me.FormBorderStyle = FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized
End If
If e.KeyCode = 27 Then
Me.FormBorderStyle = FormBorderStyle.Sizable
Me.WindowState = FormWindowState.Normal
End If
End Sub
-------------------------------------------------------
The problem with this is when the button looses focus() it does not work is there any other way to make it work.
thanks in advance
This is my first post here.
This is my problem.
I am making a drawing application . One of its functionality is to switch to full screen mode when the key "f" is pressed and back to its normal position when the key "esc" is pressed.
Right now Iam keeping the code to do this in a button
-------------------------------------------------------
Private Sub Button1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button1.KeyUp
If e.KeyCode = 70 Then
Me.FormBorderStyle = FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized
End If
If e.KeyCode = 27 Then
Me.FormBorderStyle = FormBorderStyle.Sizable
Me.WindowState = FormWindowState.Normal
End If
End Sub
-------------------------------------------------------
The problem with this is when the button looses focus() it does not work is there any other way to make it work.
thanks in advance