Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - How to set size of Panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to set size of Panes

 Post Reply Post Reply
Author
Message
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Topic: How to set size of Panes
    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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
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.203 seconds.