Accessing Form's Control from another class C#

前端 未结 4 1251
礼貌的吻别
礼貌的吻别 2020-12-19 10:38

I\'m a newbie in c# and visual studio, but not programming in general. I searched for answer to my question for 3 days and I found plenty of them, but for some weird reason

4条回答
  •  清酒与你
    2020-12-19 11:16

    Sending form instance to other other class

    Form1 objForm1=new Form1();
    obj.Validate(objForm1);
    

    Easy way to access controls in another class by modifying Controls Private to Public in the Form(Designer.cs)

提交回复
热议问题