I tried to change a TextBox
text from another class by doing this :
my form1:
public void showLog(string s)
{
txtlog.Text = s;
}
and my class:
class Functions
{
private readonly Form1 form;
public Functions(Form1 form)
{
this.form = form;
}
public Functions()
{
}
private void FindDlLinks(string url)
{
// line bellow gave me a NullReferenceException error
form.showLog("something");
}
}
And the error is :
Object reference not set to an instance of an object.
it works with a simple MessageBox
but seems there is something with my TextBox
.