E
Enkidu
I've not much experience of C#, so maybe someone can help me with this
little problem?
I've discovered that an event handler seems to be able to call methods
in its own class, but not in other classes even if they are 'in scope'
(if that is the correct term).
For instance:
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "Do nothing!";
Program.pgm.doNothing();
}
If the 'doNothing' line is commented the method changes the text of the
label on clicking the button. If the 'doNothing' line is included the
program compiles but when the method is executed (as evidenced by
stepping through it), but on return the whole application closes, with
no errors. What am I missing?
Cheers,
Cliff
little problem?
I've discovered that an event handler seems to be able to call methods
in its own class, but not in other classes even if they are 'in scope'
(if that is the correct term).
For instance:
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "Do nothing!";
Program.pgm.doNothing();
}
If the 'doNothing' line is commented the method changes the text of the
label on clicking the button. If the 'doNothing' line is included the
program compiles but when the method is executed (as evidenced by
stepping through it), but on return the whole application closes, with
no errors. What am I missing?
Cheers,
Cliff