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)
精彩评论