Dominating
Dominating

Reputation: 2930

Popup temporary form in the current one

I have one main form and another which I have to popup in the following code:

private void barButtonItemEditCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
    {
        PopupForm pop = new PopupForm();
        pop.Show();
    }

and I want when event itemclick happens to lock current form afret pop.Show() and after closing pop form to continue with the main one. Now when I hit itemclick event the whole function pass and after that I see the popupform and my main form from which I popup is still available.

Upvotes: 1

Views: 792

Answers (2)

Sanjeevakumar Hiremath
Sanjeevakumar Hiremath

Reputation: 11263

Assuming PopupForm is a (System.Windows.Forms.Form) winform. pop.ShowDialog() would show a modal dialog, and lockup other form till this modal dialog is closed. check here

Upvotes: 3

Øyvind Bråthen
Øyvind Bråthen

Reputation: 60724

Try replacing pop.Show(); with pop.ShowModal();

This will lock your original form for any input before you have closed the modal form.

Upvotes: 1

Related Questions