Arijeet Ghosh

Arijeet Ghosh

  • NA
  • 210
  • 37.2k

How will the value of the controls in the user-control change by code?

Jul 7 2020 1:03 AM
I have an user-control. It has got some controls. The user-control is drawn on the form. All the controls in the user control have public access modifiers when designing the control. There is no code in the usercontrol. These controls are accessed
through the external code in this way:-
   usercontrol1 u=new usercontrol1();
   u.Label1.Text="k";
 }
Uptill this is okay. But during 'run' by pressing F5 Label1 of the user control is showing text as "Label1" and not "k".
 
How will the value of the controls in the user-control change through external code...?

Answers (1)