Print Page | Close Window

How to set size of Panes

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=11301
Printed Date: 29 September 2024 at 8:50pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to set size of Panes
Posted By: chrisABC
Subject: How to set size of Panes
Date Posted: 03 July 2008 at 7:44pm
I have a DockingPane with two panes  (non-floating).

I load a form into each Pane.   (.handle = form.hwnd)

How can I set the size of the Pane to match the size of the Form?
I have played about with MaxTrackSize.SetSize and MinTrackSize etc  but this does not seem to resize the Panes.

I want to set the initial size of the Pane, but allow the user to make it smaller afterwards.




-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6



Replies:
Posted By: Aaron
Date Posted: 04 July 2008 at 1:05am
Hi,
 
When you create the pane:
 
Set pane = DockingPane1.CreatePane(1, 100, 200, DockRightOf, Nothing)
 
width and height will be used to size the pane.
 
DockTopOf and DockBottomOf will use width value
DockLeftOf and DockRightOf will use height value
 
You can't have both with non-floating panes.


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: chrisABC
Date Posted: 04 July 2008 at 2:41am
Thanks. But at the time I create the pane I do not know size of form that will later be attached to it.

I have now discovered the .DockPane method which seems to do what I want.  Putting -1 as the size of the "docked" edge seems to work OK (stretches pane to fill container along the docked edge).

So my code that sizes a pane to match new Form is something like:

     Pane.handle = NewForm.hwnd
     DPM.DockPane Pane, -1,  newForm.ScaleHeight, DockTopOf, null
    
     Pane.MaxTrackSize.SetSize -1, newForm.ScaleHeight
     Pane.MinTrackSize.SetSize -1, newForm.ScaleHeight * 0.3




-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6


Posted By: Aaron
Date Posted: 04 July 2008 at 3:36am
Hi,
 
You know which form will be attached to a pane, right?
 
Dim frm As New Form1 'create instance of the form
            
    Set pane = DockingPane1.CreatePane(1, frm.ScaleWidth / Screen.TwipsPerPixelX, frm.ScaleHeight / Screen.TwipsPerPixelY, DockRightOf, Nothing)
       pane.Handle = frm.hWnd 'or attach later in dockingpane attach event
 
 
 
Just an option
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: chrisABC
Date Posted: 04 July 2008 at 9:07am
No, I am more difficult

I have two panes, and keep changing the Form that is in each pane as user makes selection.  I was detroying and creating the panes each time, but now I have got it working with DM.DockPane .......




-------------
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6


Posted By: Baldur
Date Posted: 09 July 2008 at 10:10am
I found, that in CreatePane the width and height are only "StartValues".
The real width and height is calculated from the form containing the DockingPane-Control.
So if you want, that your forms are specific in width and height, than the containerform has to have the correct size.
 
Min/MaxTracking works only for undocked panes.


Posted By: Aaron
Date Posted: 09 July 2008 at 11:27am
Originally posted by Baldur Baldur wrote:

I found, that in CreatePane the width and height are only "StartValues".
The real width and height is calculated from the form containing the DockingPane-Control.
So if you want, that your forms are specific in width and height, than the containerform has to have the correct size.
 
Min/MaxTracking works only for undocked panes.
 
Hi Baldur,
 
I have to correct you on this. The CreatePane init values are used to size the form. Of course this is not the case when you have multiple panes, one docked to the top, one to the right and one docked to the left. If you would dock all the panes (for example DockRightOf), the width value in CreatePanes will be used and height will be the form height (so form will be resized and not as you would have in the IDE). DockingPane will always use the entire width or height (depends where the pane is docked) of it's container.
 
And for the Min/MaxTracking works also for docked panes. I have RC and a propertygrid in a form and I want to prevent the user from resizing the propertygrid to the full width of the form, so I set these value Min = 300 and Max = 500 and this will allow the user to resize it between these two values.
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



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