| How to resize a docking pane from code
 
 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=21572
 Printed Date: 28 October 2025 at 5:31am
 Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
 
 
 Topic: How to resize a docking pane from code
 Posted By: davidecapod
 Subject: How to resize a docking pane from code
 Date Posted: 02 April 2013 at 8:20am
 
 
        
          | Hi all, I need to programmatically resize a docking pane from code.
 My purpouse is to implement a "dynamic" pane that opens and closes with different sizes depending of a context; to do this I call CXTPDockingPaneManager::ShowPane and CXTPDockingPaneManager::ClosePane from code, but I need to set an initial height of the pane when I show it.
 
 I tried to fix the height using SetMinTrackSize and SetMaxTrackSize with the height value I want in the OnDockingPaneNotify handler, and then restoring min/max track size (after some milliseconds with a timer) to allow further resizing from the user.
 
 This seems to work, but sometimes when I manually change the layout of the docking panes (for example, show or hide another pane) my pane gets resized to a wrong size, losing the height I had set with SetMinTrackSize and SetMaxTrackSize.
 It seems to me that the SetMinTrackSize/SetMaxTrackSize way does not "fully resize" internally the pane (maybe m_rcWindow and/or m_szDocking?).
 
 How can I do a proper and reliable resizing by code?
 Thanks
 Davide
 
 
 |  
 
 Replies:
 Posted By: mgampi
 Date Posted: 01 September 2016 at 9:08am
 
 
        
          | Hi; 
 I need this too!
 Any ideas yet?
 
 M.
 
 
 -------------
 Martin
 
 Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
 Platform: Windows 10 v 22H2 (64bit)
 Language: VC++ 2022
 |  
 Posted By: mgampi
 Date Posted: 01 September 2016 at 11:30am
 
 
        
          | To be more specific: 
 I have two docking panes that are shown in a mutual way at the same docked position.
 When pane 1 is shown and resized by the user via splitter the hidden pane 2 should get the size of pane 1 as soon as it becomes visible.
 I have no idea where to start from...
 
 Thanks in advance
 
 Martin
 
 
 -------------
 Martin
 
 Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
 Platform: Windows 10 v 22H2 (64bit)
 Language: VC++ 2022
 |  
 Posted By: davidecapod
 Date Posted: 22 September 2016 at 6:22am
 
 
        
          | Hi, we just upgraded to the latest version of XTP (17.2.0.), and we will see if with this version things are better... See my old first message about our current implementation using SetMinTrackSize/SetMaxTrackSize.
 |  
 
 |