如何在MDI应用程序中使用样式模态形式C#

问题描述 投票:-1回答:1

我正在制作一个MDI应用程序,我想在其中使用StyleManager作为mdi父级和子级。除了使用`ShowDialog()方法调用的MDI子项外,它工作正常。有没有一种方法可以像非模态形式(具有相同的标题栏,样式,颜色......)那样设置模态形式?

c# modal-dialog mdi mdichild dotnetbar
1个回答
0
投票

我希望“编辑帐户”表单显示为“管理帐户”表单。我想保持与主应用程序相同的显示样式。实际上我在主应用程序中使用了stylemanger。

this.styleManager1.ManagerStyle = DevComponents.DotNetBar.eStyle.Office2016;

这是我的代码:

public partial class frmMain : RibbonForm
{
   public  frmAccounts fA = new frmAccounts();
   private void btn_accounts_Click(object sender, EventArgs e)
   {
     fA.Show();
     fA.MdiParent = this;
   }
}

结果:

frmAccont

public partial class frmAccounts : OfficeForm
{
 private void btn_edit_Click(object sender, EventArgs e)
 {
    frmEditAccount ed = new frmEditAccount();
    ed.EnableCustomStyle = true ;
    DialogResult res =ed.ShowDialog();
    if (res == System.Windows.Forms.DialogResult.OK)
        {
        .....
        ....
    }
 }
}

结果:frmEditAccount

© www.soinside.com 2019 - 2024. All rights reserved.