-1

I'm making an MDI application in which I would like to use the StyleManager for the mdi parent and childs. It works fine except for an MDI child called with the `ShowDialog() method. Is there a way to style a modal form the same way as a non-modal form (having the same titlebar, style, color, ...)?

Picture1: Main form with ribbon

Stephan Bauer
  • 9,120
  • 5
  • 36
  • 58
  • What did you try so far? Post your code! What happened when you ran it? What did you expect to happen instead? What specifically are you having problems with? – Robert Oct 17 '16 at 02:54
  • when I want to make the call to an interface via the showDialog () method, I get a different style to that of a known interface using the show () method. I understand that there is a difference between a modal form and a MDI child, but I want to know is there a possibility to display a modal form via the showDialog () function and I get the same style (title bar, shape, color, ...) than the main form. Watch the screenshot of my application: [https://i.stack.imgur.com/Yovis.png] – Khaled Idoudi Oct 17 '16 at 12:01
  • the Edit Account form is called by the showDialog () function, by against the Manage Account form is called via the show () function – Khaled Idoudi Oct 17 '16 at 12:07

1 Answers1

0

I want the Edit Account form is displayed as the form Manage Accounts. I want to keep the same display style as the main application. in fact I use a stylemanger in the main application.

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

this is my code:

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

Result:

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)
        {
        .....
        ....
    }
 }
}

Result: frmEditAccount

Stephan Bauer
  • 9,120
  • 5
  • 36
  • 58