Dave,
You should have a field in the class itself for the Form1 instance. If
it is null, then create a new instance, and assign. You also want to hook
up to the Disposed event on the form, in the event that the form is closed.
Then in the event handler for the Disposed event, you would set the field
back to null.
Then, call Show on the instance.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"dave" <sp*****@nospammer.netwrote in message
news:Lu****************@bignews7.bellsouth.net...
Hi ,
I am trying to avoid behavior where everytime Button1Click is fired a new
form is exposed.
How can I keep the f object alive in the event so that a new object does
not
have to be created?
Could I overload the Button Click event to accept the Form1 object?
void Button1Click(object sender, EventArgs e)
{
Form1 f = new Form1();
f.Show();
f.TextboxGet(this.textBox1.Text);
}
Thanks
D