开发者

Popup temporary form in the current one

开发者 https://www.devze.com 2023-02-16 20:20 出处:网络
I have one main form and another which I have to popup in the following code: private voi开发者_开发问答d barButtonItemEditCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)

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

private voi开发者_开发问答d 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.


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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消