how to disable the alt+F4 key for the windows form
i want to disable the form option alt+F4 key due to which it is closing my form,the form is login form in my application.
I need the solution for this problem.
Windows Forum
i want to disable the form option alt+F4 key due to which it is closing my form,the form is login form in my application.
I need the solution for this problem.
by samohod26 Accepted solution
by tony hopkinson Accepted solution
Don't know what language you are using
if (myLoginForm.ShowModal == mrOK)
{ // check user name and password
// if not valid exit the application and}
else
// exit the application;
Otherwise the would have to login before they could could log out and exit.
by starwin_ms Accepted solution
var altDown=0;
if (typeof window.event != 'undefined'){
document.onkeydown = function(){
window.status=event.keyCode
if(event.keyCode == 18)altDown=1;
alert();
if(event.keyCode == 115&&altDown==1)
event.returnValue=false;
altDown = 0;
}
}
by suscriber07.siva Accepted solution
The following code will disable the functionality of Alt+F4 key in ur Form
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
e.Cancel = True
Me.OnClosing(e)
End Sub
This discussion is closed to new replies.
Sort by Trending