Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - docking pane border
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

docking pane border

 Post Reply Post Reply
Author
Message
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Topic: docking pane border
    Posted: 22 February 2008 at 10:42am

I have a vb6 sdi for that has a commandbar and (standard windows) status bar. I am creating docking panes at run-time based on the user's clicking items from a treeview control. The panels are being created okay but there is a small problem... when a panel is initially displayed (docked right of) the height of the panel extends so that the bottom portion of the panel is behind the status bar (i.e., I cannot see the frame on the bottom of the panel). Howeverm when I hide and redisplay the panel the height is set so that the bottom frame shows (i.e., it does not extend below the status bar). What can I do to correct this so that when the panel is first shown it does not drop down below the status bar?

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 12:00pm
Be sure you are doing this:

http://codejock.com/support/articles/com/dockingpane/dp_3.asp

And try using CommandBars Resize event.
Back to Top
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 12:17pm
Thanks for the reply. My problem is not with the docking pane and the command bar (that's working just fine). It is with the docking pane and the statusbar at the bottom of the form. When i first create the panel and show it the panel is too long for the form and the bottom portion of the panel is hidden behind the status bar. if i hide (unpin) the panel and then click it's tab the panel is properly sized (hieght wise) between my command bar and the status bars
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 12:22pm
Maybe try:

Private Sub CommandBars_GetClientBordersWidth(Left As Long, Top As Long, Right As Long, Bottom As Long)
   
    If sbStatusBar.Visible Then
        Bottom = sbStatusBar.Height
    End If

End Sub
Back to Top
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 12:31pm
Yes, I have that in my code. As I said, the panel shows at the proper size once it has been hidden and redisplayed. I can't think of any code that I've written that would affect this behavior.
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 12:51pm
Can you attach a small sample?
Back to Top
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 2:34pm

Sorry, how do I attach my sample

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 2:43pm
you have to hit the reply button or the option won't show up.
Back to Top
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 2:56pm
Thanks. I created a small project to try and show the problems I am having. You will set that the main show two panels when it is first loaded. These panels are docked to the bottom of the form. The problem is (I posted a question about this yesterday) is that no matter what I try I cannot get the width of these panels such that the left-hand side of each panel ends at the tree view control... thus, I cannot see the panel captions.
 
The second issue that I thought I was having (and which is the subject of this post) was that if you click Panel A in the tree view control a panel appears docked to the right side of the main form. I have since determined that the black border around the form in this panel is the result of having a hidden menu on the form. However, in this sample project, the height of the panel is correct both when it is intially displayed and hidden/unhidden. I guess I must have something different in my 'real' project - which is too large to send - that is causing the problem I am having
Back to Top
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 2:57pm
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 3:38pm
Think maybe this is what you want?

Private Sub CommandBars_Resize()

    On Error Resume Next
   
    Dim Left As Long
    Dim Top As Long
    Dim Right As Long
    Dim Bottom As Long
   
   CommandBars.GetClientRect Left, Top, Right, Bottom

    If Right >= Left And Bottom >= Top Then
        TreeView1.Move Left, Top, Right - Left, Bottom - Top
    Else
        TreeView1.Move 0, 0, 0, 0
    End If
       
End Sub
Back to Top
johnp View Drop Down
Groupie
Groupie
Avatar

Joined: 21 February 2008
Status: Offline
Points: 49
Post Options Post Options   Thanks (0) Thanks(0)   Quote johnp Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2008 at 5:42pm
After adding your code, my treeview control is now at the top of my form (under the command bar) and spans the entire width of the form.
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: 23 February 2008 at 1:37am
Hi,
 
When using commandbars with dockingpanes, commandbars will handle all resizing events for you. (DockingPane.SetCommandBars Me.CommandBars)
 
also the ResizeClient event.
so you could determine what space you have left for the treeview like this:
 
Private Sub CommandBars_ResizeClient(ByVal Left As Long, ByVal Top As Long, ByVal Right As Long, ByVal Bottom As Long)
   
    If StatusBar1.Visible Then Bottom = StatusBar1.Top
    TreeView1.Move Left, Top, Right - Left, Bottom - Top
End Sub
 
Docking the panes at startup:
I haven't found a way to lock the client area on a certain position, maybe it's possible, maybe not. So, docking the panes to the right side of the form will position the client area on the left side. If you want the second pane below the first one you can use the last param to dock that pane as neighbour:
 
Dim Pane
Set Pane = DockingPane.CreatePane(1, 400, 200, DockRightOf, Nothing)
 
Dim Pane2 As Pane
    Set Pane2 = DockingPane.CreatePane(2, 400, 200, DockBottomOf, Pane) ''Pane is the pane you already created
 
I would use the statusbar of commandbars so you don't have to deal with size and position etc. when dragging toolbars to the bottom of the form. Test this and you will see what I mean. 
 
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.125 seconds.