• 0

[C#] Disable Alt+F4/Closing Form


Question

6 answers to this question

Recommended Posts

  • 0

Never mind found somthing that works :)

protected override System.Boolean ProcessCmdKey(
 	 ref System.Windows.Forms.Message msg,
 	 System.Windows.Forms.Keys keyData)
  {
 	 if ((msg.Msg == 0x104) && (((int) msg.LParam) == 0x203e0001))
    return true;

 	 return false;
  }

Link to comment
Share on other sites

  • 0

you can handle the form closing event easily by setting the e.cancel = true, i think its true i forgot true or false, this will stop people from closing the app from the close button and Alt + F4

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.