C# Show dialog over another dialog in winforms?

▼魔方 西西 提交于 2019-12-24 03:19:55

问题


I have a winforms application (C#) and in one of my forms, i have a dialog that adds some entity to a datagrid in the main form. In this dialog, i have validations that if they are invalid, those errors are showed in a new dialog.. my problem is that this error dialog shows on the back of the first dialog... how can i do to show the errors dialog over the first dialog?

My form is something like this:

MainForm----DataGridButton---Add entity---> OpenDialog1 ---> OpenDialog1-Validation --- On Errors ---> OpenDialogErrors (This dialog is showed on the "back" of OpenDialog1)

The OpenDialog1 shows the OpenDialogErrors like this:

FrmErrors err = new FrmErrors();
err.ShowDialog(this.MdiParent);

回答1:


Try to show OpenDialogErrors this way:

err.ShowDialog(this);


来源:https://stackoverflow.com/questions/22206340/c-sharp-show-dialog-over-another-dialog-in-winforms

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!