Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Multiple Forms and Disable Keyboard shortcut

$
0
0

Hi All,

1. How I can disable the Alt+Tab using Visual Studio 2010?

2. I need to disable the Alt+F4 on all the forms that I have in my project.
    Following code worked fine on a single Form, it didn't worked on all forms. If I have more
    forms the last form worked with this code.  Here is code:

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        '  Code to Override the Alt-F4 keys combination
        If e.KeyData = Keys.Alt + Keys.F4 Then
            MessageBox.Show("Nice Try!  You must log on with a password.", "Security", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
            e.Handled = True
        End If
    End Sub


N.A.Malik


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>