Page 1 of 1

Code to Dock A maintenance form

PostPosted: Sun Dec 10, 2017 5:05 pm
by SBarnes
What is the necessary code to dock and undock a maintenance form and where is a form being shown should the code go to make it be docked when shown?

I have the following code in a form shown event

Code: Select all
         this.MdiParent = null;
         this.WindowState = FormWindowState.Maximized;
         this.WindowState = FormWindowState.Normal;
         this.MdiParent = Manager.MDIParentForm;


And this works fine when the form is shown but without the following code in a SetupBeforeHandlers, the form jumps as soon as you click in a JiwaGrid and the ribbon disappears up under the title bar of the mdi frame.

Code: Select all
      public override void SetupBeforeHandlers()
      {

         base.SetupBeforeHandlers();
         this.MdiParent = Manager.MDIParentForm;

      }

Re: Code to Dock A maintenance form  Topic is solved

PostPosted: Mon Dec 11, 2017 9:17 am
by Mike.Sheen
SBarnes wrote:What is the necessary code to dock and undock a maintenance form and where is a form being shown should the code go to make it be docked when shown?

I have the following code in a form shown event

Code: Select all
         this.MdiParent = null;
         this.WindowState = FormWindowState.Maximized;
         this.WindowState = FormWindowState.Normal;
         this.MdiParent = Manager.MDIParentForm;



You don't need that code in the shown handler - you just need what you already have below in the overridden SetupBeforeHandlers method:

SBarnes wrote:
Code: Select all
      public override void SetupBeforeHandlers()
      {

         base.SetupBeforeHandlers();
         this.MdiParent = Manager.MDIParentForm;

      }

Re: Code to Dock A maintenance form

PostPosted: Mon Dec 11, 2017 9:35 am
by SBarnes
Hi Mike

Thanks, for the quick reply.