Question

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();
Was it helpful?

Solution 2

You need to use

addProblem.ShowDialog();

instead of

addProblem.Show();

so that it will open a modal dialog.

OTHER TIPS

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.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top