J
josh
Hi, if I want to use these following code I got a compiler error:
public Log()
{
Form1 f = new Form1();
static printLogTo()
{
f.textEdit1.Text = "some error...";
}
}
I understand that I cannot use f as when I call Log.printLog() f has
not been created so f has not an instance of
its class.
So how can I instantiate f for using in my static method?
P.S.
In Java I can do:
static
{
// some instructions will be executed here...
}
public Log()
{
Form1 f = new Form1();
static printLogTo()
{
f.textEdit1.Text = "some error...";
}
}
I understand that I cannot use f as when I call Log.printLog() f has
not been created so f has not an instance of
its class.
So how can I instantiate f for using in my static method?
P.S.
In Java I can do:
static
{
// some instructions will be executed here...
}