Directly write the label control in the Code. winform C # Can Be Used for loop, which is convenient and practical for summary of small code.

Source: Internet
Author: User

This. controls ["label1"]. Text = "ABC"; after studying reflection for half a day, it is found that controls can directly control the controls in winform. Shame .. Next, we will study how to call the label in winform in the class library. If you have any idea, please leave a message. I don't know. Please continue ..

 

Public static void setlabel (vstest01.form1 f) {f. controls ["label1"]. TEXT = "setlabeldo";} setcontrols is used in winform. setlabel (this); vstest01 is the project name. This is how inspiration is generated. Roar ~~ This solves the problem of efficiency in calling Space directly in the class library, and does not use reflection.

 

In general, the previousCodeThe external class library cannot call the label on winform, but can be written in the project. The division of labor is clear. The class library contains the write logic relationship. The control should be written in the project and separated from the class library. The summary is complete. Prepare for cooking 7.

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.