best practices to call methods in the parent form and access gui elements in parent form in c#

后端 未结 3 514
刺人心
刺人心 2021-01-12 05:18

I am developing a win form app and I found myself constantly requiring to access methods in my parent form say Form1 from another class be it a form class or just a class. I

3条回答
  •  佛祖请我去吃肉
    2021-01-12 05:54

    Your class should raise events and your form should have the event handlers. This keeps your form code in your form and your class code in your class. Nice and neat.

提交回复
热议问题