C# Show dialog over another dialog in winforms?

2019-07-07 19:18发布

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条回答
姐就是有狂的资本
2楼-- · 2019-07-07 19:52

Try to show OpenDialogErrors this way:

err.ShowDialog(this);
查看更多
登录 后发表回答