im making a computer locking program which makes you enter a password to close it...
i need to prevent the user from pressing ALT + F4... I tried simply modifying the keypress event but it isnt working... why? do i need to use an api or somthing?
VB Code:
Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown, Me.KeyDown If e.KeyData = Keys.Enter Then e.SuppressKeyPress = True If TextBox1.Text = pas Then Me.Close() End If End If If e.Modifiers = Keys.Control + Keys.F4 Then e.SuppressKeyPress = True End If End Sub




Reply With Quote