How to: Inherit Windows Forms

Source: Internet
Author: User
ArticleDirectory
  • Inherit the form programmatically

Creating a Windows form by inheriting from the base form is a quick way to repeat the best results, instead of creating a new form from the beginning each time you need it.

For more information about using the inheritance selector dialog box during design to inherit the form and how to visually distinguish the security level of the inherited control, see .

Note that to inherit from a form, the file or namespace containing the form must have been compiled into an executable file or DLL. To compile a project, select "compile" from the "compile" menu ". References to the namespace must also be added to the class that inherits the form. The displayed dialog box and menu command may be different from the description in "help", depending on your current settings or version. To change the settings, select "Import and Export Settings" from the "Tools" menu ". For more information, see .

Inherit the form programmatically
  1. In the class, add a reference to the namespace, which contains the form to inherit from.

  2. In the class definition, add the reference to the form to inherit from. The reference should include the namespace containing the form, followed by a period, followed by the name of the base form itself.

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.