开发者

How to access a control form from a constructor in another class

C# question: I have a textBox in a default form Form1 and I want to access (write on) it开发者_运维知识库 from a constructor in another class that is in another different file. How can I do it?

Tx in advance, Gerard


You need to make a property in the Form1 class that exposes the textbox or its Text property, then pass an instance of the Form1 class to the constructor. (Or as a static proeprty)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜