Communication Between Two Forms-enable/disable button

  • Thread starter Thread starter Suni
  • Start date Start date
S

Suni

Hi everybody,
But what I am trying to do is like, there are 2 forms, and if I click on the
button in form1, it'll open up form2 and disable the button in form1. Then
when I click on the button in form2, it will close form2, and then enable
the button in form1. Could you please give me some hints about this?

Thanks,
Suni
 
Hi Suni,
Hi everybody,
But what I am trying to do is like, there are 2 forms, and if I click on the
button in form1, it'll open up form2 and disable the button in form1. Then
when I click on the button in form2, it will close form2, and then enable
the button in form1. Could you please give me some hints about this?

Thanks,
Suni

You can handle the Closed event to enable this button
(e.g. buttonStartForm2):

private void form2_Closed(object sender, EventArgs e) {
buttonStartForm2.Enabled=true;
}

Disable this button on start of form2 and then handle
form2.Closed event.

Regards

Marcin
 
Back
Top