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.