Reputation: 232
In my form i have button to show other form.
But i want the previously form cannot be clicked before the new form is closed , How to create that ?
Because if the previously form is clicked, and i click the button again, the form is show multiple. this my code in button click :
MDACS_AOP_CFSTL_InputActivity addProblem = new MDACS_AOP_CFSTL_InputActivity(ParameterSesi, ParameterNamaKaryawan, ParameterTanggal);
//addProblem.Close();
addProblem.Show();
Upvotes: 1
Views: 52
Reputation: 283
You should use
addProblem.ShowDialog(this);
This will open the dialog as child of the parent (this) dialog. You cant click the parent dialog but you can still see it.
Upvotes: 3
Reputation: 2640
You need to use
addProblem.ShowDialog();
instead of
addProblem.Show();
so that it will open a modal dialog.
Upvotes: 1
Reputation: 1099
You could use
MDACS_AOP_CFSTL_InputActivity addProblem = new MDACS_AOP_CFSTL_InputActivity(ParameterSesi, ParameterNamaKaryawan, ParameterTanggal);
this.Hide;
addProblem.ShowDialog();
this.Show();
The show(); command will not be executed until the dialog is close. So it will stay hidden
Upvotes: 1