Changing the control in winform causes the code in designer to be automatically removed. solution:

Source: Internet
Author: User

During development, copy the control from an existing form and paste it to the new form. After adjustment, add the new control. In most cases, there is no problem. However, I recently encountered a problem: I copied the dview and some other controls to the new form and added several buttons. At first there was no problem. Later, I set many datagridview attributes, when you are satisfied, an error occurred while adjusting the property compilation of other buttons.CodeThe datagridview dview is not found, but it does exist on the interface. It is found that the declaration of this control is not found in the last control declaration of the designer file. Therefore, the Declaration is manually added and compiled. However, when I adjusted the interface control attributes, the Declaration was gone. After repeated experiments, it was found that some of the controls copied from other forms are in the designer file, but they are not displayed on the interface and are useless, so they are deleted, adjust the interface control again. The problem does not exist.

 

It takes a long time to discover the problem, which is recorded here.

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.