M
mmatchyn
Is there a way to pass an object when including a class?
For example...
namespace testclass
{
public System.Windows.Forms.TextBox textbox;
public class Write
{
public Write(string msg)
{
textbox.text = msg;
}
}
}
So when I call the following:
using testclass
I would like to pass in the textbox from the form. I don't want to
have to pass the textbox every time I call the write methode. Is
there a way I can set this up in the using or one line of code shortly
after but independant and outside of the write class?
For example...
namespace testclass
{
public System.Windows.Forms.TextBox textbox;
public class Write
{
public Write(string msg)
{
textbox.text = msg;
}
}
}
So when I call the following:
using testclass
I would like to pass in the textbox from the form. I don't want to
have to pass the textbox every time I call the write methode. Is
there a way I can set this up in the using or one line of code shortly
after but independant and outside of the write class?