Print Page | Close Window

Pane in an MDI Child in VB.net

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Active-X COM Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=2131
Printed Date: 12 May 2024 at 2:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Pane in an MDI Child in VB.net
Posted By: ihu77
Subject: Pane in an MDI Child in VB.net
Date Posted: 20 April 2005 at 9:49am

Hello

I would like to have a MdiContainer with a frmChild in VB.net. Inside the frmChild I would like to have two panes. How does this work?

I have a mdiForm (isMdiContainer = True) and I would like to open a ChildForm frmChild in the mdiForm...like this

Private Sub LoadNewChild()
   Dim frmChild as frmChild
   frmChild = New frmChild
   frmChild.MdiParent = Me
   frmChild.Show()
End Sub

Inside the frmChild I would like to place 2 panes (frmPaneA, frmPaneB)...like this

Private Sub frmChild_Load(....) Handles myBase.Load
   Dim frmPaneA as Pane = DockingPaneManager.CreatePane(0,200,120,DockingDirection.Doc kLeftOf, Nothing)
   Dim frmPaneB as Pane = DockingPaneManager.CreatePane(0,200,120,DockingDirection.Doc kTopOf, frmPaneB)
End sub

If I insert like above the code frmChild.MdiParent = Me in mdiForm then no panes will appear in frmChild.
If I delete frmChild.MdiParent = Me in mdiForm, it works with the panes but the frmChild is not a Child in mdiForm anymore.

Could someone help me?

Thank you very much.




Replies:
Posted By: SuperMario
Date Posted: 07 June 2005 at 8:36am
Due to the way .NET opens MDIChild forms, there is a specific way you must use DockingPanes when displaying them in a MDIChild form. 

1. Add the DockingPane Control to the MDIChild form.
2. Delete the DockingPane Control from the MDIChild form.  This adds the references needed to use the control.
3. Add Imports XtremeDockingPane to the MDIChild form.
4. Add "Friend WithEvents DockingPaneManager As AxXtremeDockingPane.AxDockingPane" in the MDIChild class.
5.
        Private Sub frmDocument_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         &nbs p;  Me.DockingPaneManager = New AxXtremeDockingPane.AxDockingPane()
         &nbs p;  CType(Me.DockingPaneManager, System.ComponentMode l.ISupportInitialize).BeginInit()
         &nbs p;  Me.SuspendLayout()
         &nbs p;  Me.DockingPaneManager.Enabled = True
         &nbs p;  Me.DockingPaneManager .Location = New System.Drawing.Point(1, 1)
         &nbs p;  Me.DockingPaneManager.Name = "DockingPaneManager"
         &nbs p;  Me.DockingPaneManager.Size = New System.Drawing.Size(24, 24)
         &nbs p;  Me.DockingPaneManager.TabIndex = 0

         &nbs p;  Me.Controls.Add(Me.DockingPaneManager)
         &nbs p;  CType(Me.DockingPaneManager, System.ComponentModel.ISupportInitialize).EndInit()
         &nbs p;  Me.ResumeLayout(False)

         &nbs p;  DockingPaneManager.ScaleMode = XtremeDockingPane.XTPScaleMode.xtpScalePixel

         &nbs p;  Dim PaneProperties As Pane
         &nbs p;  PaneProperties = Me.DockingPaneManager.CreatePane(1, 210, 120, XtremeDockingPane.DockingDirection.DockLeftOf, Nothing)
         &nbs p;  PaneProperties.Title = "Properties"
        End Sub



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