|
Support
ActiveX / COM
Visual C++ / MFC
Customer Spotlight
Corporate Partners
Contact Sales
Call center available M-F 9:00 - 6:00 US Eastern Time. U.S. and Canada International Email |
Programmatically Moving\Docking an Existing Pane
Author: Mike Palmatier
Posted: April 26, 2006
Environment: Visual Basic 6.0
Downloads:
To programmatically dock a pane, you will need to destroy the pane, then create a new pane, using the CreatePane method to specify the new place
to dock the pane.
'Dock the pane with Id ID_SEARCH_PANE to the right of 'the application MoveSearchPane ID_SEARCH_PANE, 200, 200, _ DockingDirection.DockRightOf
'Subroutine used to dock a pane to the top, bottom, left, or right 'side of an application Private Sub MoveSearchPane(PANE_TO_MOVE As Integer, nWidth As _ Integer, nHeight As Integer, _ Optional Direction = DockingDirection.DockLeftOf)
Dim Pane As Pane Dim sTitle As String Dim iIconId As Integer
'Search for a pane with Id PANE_TO_MOVE Set Pane = DockingPaneManager.FindPane(PANE_TO_MOVE)
'If a pane with Id PANE_TO_MOVE exists save the Title and 'IconId, then destroy it If Not Pane Is Nothing Then
'Save Title sTitle = Pane.Title
'Save IconId iIconId = Pane.IconId
'Destroy Pane with Id PANE_TO_MOVE. ' 'NOTE: The instance of the attached form\object still 'exists and is not deleted, only the pane DockingPaneManager.DestroyPane Pane End If
'Creates new pane docking it in the new location, when the 'attach_pane event is called (which is the first time the 'pane becomes visible) the old form\object will get attached 'to the new pane Set Pane = DockingPaneManager.CreatePane(PANE_TO_MOVE, _ nWidth, nHeight, Direction, Nothing)
'Restore Title and IconId Pane.Title = sTitle Pane.IconId = iIconId
End Sub |
