C # event handling in the inheritance window

Source: Internet
Author: User

A problem encountered in the statistical system was finally solved, but it was still difficult for me to debug it for so long.

The execution sequence of events that inherit forms and controls is generally a queue.

First come, first registered first.

C #, Java inheritance execution starts from its parent.

Problem/summary:

1. In winform, when form. CS (default) is enabled, it loads its parent constructor and form_load.

2. Type: cboyear. selectedindexchanged + = new system. eventhandler (cboyear_seletedindexchanged) is only the event registration, passing the function address, which was previously thought to be executed once... Poor!

3. When you use the form tag to pass values, assign values to the overloaded constructor. After form_load combox1.datasource = xxx, the tag value will be lost. I don't understand.

4. Constructor ==> form_load. Run from top to bottom.

 

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.