How to hide or invalidate a close button in C #

Source: Internet
Author: User

1.WillControlBoxproperty is set toFalse。 This method is to let the title bar in addition to the title name of all other than the hidden, that is, the icon, minimize, maximize and close button all hidden.
2.Disable the Close button by finding it in the eventformcloseingEvent, edit the event, and write a statement in the "E.cancel = true;", so the Close button fails, press the shortcut key"ALT +Space+c"cannot be closed, only with the task manager turned off, or with a statement(“application.exit ();”)To close the generated application,WithAlt+f4"can also be closed.
3.WillFormboderstyleproperty is set toNone。 This method removes the entire title bar. This also uses the shortcut key "ALT +Space+c"cannot be closed, only with the task manager turned off, or with a statement(“application.exit ();”)To close the generated application,WithAlt+f4"can also be closed.

How to hide or invalidate a close button in C #

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.