Print Page | Close Window

MDI Child with DockingPane

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=3941
Printed Date: 28 June 2024 at 2:01am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDI Child with DockingPane
Posted By: helios456
Subject: MDI Child with DockingPane
Date Posted: 04 April 2006 at 1:46pm
I need to have a docking pane for my MDI application which I have now done, but when I try to create a second DockingPane for my MDIChild, the Panes don't display.  When I run the MDI client as it's own application there aren't any problems but as soon as I call it as an MDI child, it doesn't work anymore.  I'm using VS .NET with C# if that helps.  Any Suggestions?



Replies:
Posted By: Oleg
Date Posted: 04 April 2006 at 2:19pm

For MDI child you must move all code from Designer to OnLoad:

 

this.DockingPaneManager = new AxXtremeDockingPane.AxDockingPane();

   this.DockingPaneManager.Location = new System.Drawing.Point(8, 32);
   this.DockingPaneManager.Name = "DockingPaneManager";
   this.DockingPaneManager.Size = new System.Drawing.Size(24, 24);
   this.DockingPaneManager.TabIndex = 2;
   this.DockingPaneManager.ResizeEvent += new System.EventHandler(this.DockingPaneManager_ResizeEvent);
   this.DockingPaneManager.AttachPaneEvent += new AxXtremeDockingPane._DDockingPaneEvents_AttachPaneEventHandl er(this.DockingPaneManager_AttachPaneEvent);
   this.DockingPaneManager.GetClientBordersWi dth += new AxXtremeDockingPane._DDockingPaneEvents_GetClientBordersWidt hEventHandler(this.DockingPaneManager_GetClientBordersWidth) ;
   this.DockingPaneManager.Action += new AxXtremeDockingPane._DDockingPaneEvents_ActionEventHandler(t his.DockingPaneManager_Action);

 

this.Controls.Add (DockingPaneManager);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: helios456
Date Posted: 04 April 2006 at 7:33pm
Works. Thanks.


Posted By: Countryboy
Date Posted: 06 April 2006 at 9:00am

I'm having somewhat of the same type of problem in VB.Net.  I tried your fix and either I didn't implement it correctly or it doesn't fix my problem.  I have attached a sample of my project.  Any help you can provide would be greatly appreciated.

https://forum.codejock.com/uploads/Countryboy/2006-04-06_085910_Sample_Frame.zip - 2006-04-06_085910_Sample_Frame.zip

Thanks



Posted By: Oleg
Date Posted: 06 April 2006 at 10:00am

Ok, lets try again:

The problem:

When you call frmPluginForm.MdiParent = MDIForm

.NET destroy frame and create again with WS_EX_MDICHILD style, so all commandbarrs and dockingpanes objects destroyed. Unfortunatelly from ActiveX code We can't catch this event end recreate them.

The solution

Solution is to create DockingPane and CommandBars after you call it

Sample

create InitBars method and call it after you change frame style:

 

Public Sub InitBars()

Me.AxDockingPane1 = New AxXtremeDockingPane.AxDockingPane

Me.AxCommandBars1 = New AxXtremeCommandBars.AxCommandBars

CType(Me.AxDockingPane1, System.ComponentModel.ISupportInitialize).BeginInit()

CType(Me.AxCommandBars1, System.ComponentModel.ISupportInitialize).BeginInit()

'

'AxDockingPane1

'

Me.AxDockingPane1.Enabled = True

Me.AxDockingPane1.Location = New System.Drawing.Point(24, 32)

Me.AxDockingPane1.Name = "AxDockingPane1"

Me.AxDockingPane1.Size = New System.Drawing.Size(17, 16)

Me.AxDockingPane1.TabIndex = 0

'

'AxCommandBars1

'

Me.AxCommandBars1.Enabled = True

Me.AxCommandBars1.Location = New System.Drawing.Point(8, 56)

Me.AxCommandBars1.Name = "AxCommandBars1"

Me.AxCommandBars1.Size = New System.Drawing.Size(24, 24)

Me.AxCommandBars1.TabIndex = 1

 

Me.Controls.Add(Me.AxCommandBars1)

Me.Controls.Add(Me.AxDockingPane1)

CType(Me.AxDockingPane1, System.ComponentModel.ISupportInitialize).EndInit()

CType(Me.AxCommandBars1, System.ComponentModel.ISupportInitialize).EndInit()

Dim paneA As Pane = AxDockingPane1.CreatePane(1, 200, 120, DockingDirection.DockLeftOf, Nothing)

paneA.Title = "Pane A"

Dim paneB As Pane = AxDockingPane1.CreatePane(2, 200, 120, DockingDirection.DockRightOf, paneA)

paneB.Title = "Pane B"

'AxDockingPane1.Options.HideClient = True

'AxDockingPane1.Options.ShowCaption = False

AxDockingPane1.Options.ThemedFloatingFrames = True

AxDockingPane1.Options.LunaColors = False

AxDockingPane1.SetCommandBars(Me.AxCommandBars1.GetDispatch)

AxCommandBars1.ActiveMenuBar.Controls.Add(XTPControlType.xtp ControlButton, 10, "File")

End Sub

 

Public Sub ShowPluginForm(ByVal MDIForm As System.Windows.Forms.Form) Implements FrameNET.Interface.IPlugin.ShowPluginForm

Try

frmPluginForm = New frmchild

frmPluginForm.MdiParent = MDIForm

frmPluginForm.Show()

frmPluginForm.InitBars()

Catch err As Exception

MsgBox("Error in ShowPlugin." & vbCrLf & err.Message & vbCrLf & err.Source, MsgBoxStyle.Critical, "Security Plugin")

End Try

End Sub

 

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net