PDA

Click to See Complete Forum and Search --> : form hide


Techno
Oct 7th, 2004, 05:03 AM
hi

this is sooo frustrating

i have 2 forms

i hide form 1, and form 2 is shown

when i click a button on form 2, i want that form 2 to hide and form 1 to be shown again

how?

Cander
Oct 7th, 2004, 09:18 AM
pass a reference of each form to the other form when they are created, then acccess its methods.

Techno
Oct 8th, 2004, 07:23 AM
??

fret
Oct 9th, 2004, 02:44 AM
dunno if this help.
in the frm1:

void Button1_Click(object sender,EventArgs e)
{
Form f=new frm2(this);
this.Hide();
f.Show();
}

in the frm2:

public frm2(Form f)
{
this.f=f;
}

Form f;
void Button2_Click(object sender,EventArgs e)
{
f.Show();
this.Hide();
}

:afrog: