How to set size of Panes |
Post Reply |
Author | |
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
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
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
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
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
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
|
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
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.
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |