Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > General Discussion
  New Posts New Posts RSS Feed - Pane in an MDI Child in VB.net
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Pane in an MDI Child in VB.net

 Post Reply Post Reply
Author
Message
ihu77 View Drop Down
Newbie
Newbie


Joined: 20 April 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote ihu77 Quote  Post ReplyReply Direct Link To This Post Topic: Pane in an MDI Child in VB.net
    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.

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.