Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Position Dockingpane with CommandBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Position Dockingpane with CommandBar

 Post Reply Post Reply
Author
Message
Bjarne View Drop Down
Newbie
Newbie
Avatar

Joined: 30 December 2003
Location: Denmark
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bjarne Quote  Post ReplyReply Direct Link To This Post Topic: Position Dockingpane with CommandBar
    Posted: 28 February 2004 at 12:10pm

Hello,

I hope some out there can give me a short example on how to position a DockingPane when there is also a CommandBar with toolbars on an SDI form.

I want to show the dockingpane aligned to the right, but the Top property must be just below the Commandbar Toolbar (Just like Word 2003). I have tried different combinations of the Resize_events and GetclientRect Events, and for some reason the Dockingpane will not stay below the Toolbar. When I resize the form I can see that it moves below, but as soon as I let go of the mouse it moves all the way to the top of the form again.

So a short sample on what commands to put where would be appreciated

Bjarne

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: 28 February 2004 at 1:37pm
The correct solution is in my next post below.


Edited by SuperMario
Back to Top
Bjarne View Drop Down
Newbie
Newbie
Avatar

Joined: 30 December 2003
Location: Denmark
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bjarne Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2004 at 2:09pm

Hello SuperMario,

Yes this what what I meant. And I did do what you described above, but for some odd reason it does not work on my form. When I resize the Form by dragging its borders, I can see that the DockingPane moves to the correct top position, but as soon as I let go it moves back to 0.

On a form with a CommandBar and DockingPane, you have 3 Resize Events, where do you put your code to resize everything on the form?

On this form, I put it on the Form_Resize and then I call that procedure from the CommandBar and DockingPane Resize_Event. Is that wrong?

Bjarne

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: 28 February 2004 at 2:46pm
I'm sorry bjarne, not sure what I was thinking at the time.  All you need to do is add this line of code in the Form_Load after your command bars and docking panes are created and attached.

DockingPaneManager.SetCommandBars Me.CommandBars

Here is what is says in the help file:
"If you use both DockingPanes and CommandBars in the same form, associate the command bars with the docking pane manager using this property. This is necessary for correct resizing and layout of controls on the form."

This will fix your problem.  I was trying to do this the hard way.


Edited by SuperMario
Back to Top
Bjarne View Drop Down
Newbie
Newbie
Avatar

Joined: 30 December 2003
Location: Denmark
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bjarne Quote  Post ReplyReply Direct Link To This Post Posted: 29 February 2004 at 6:06am

Hi again SuperMario,

I just tried your suggestion, but it does not have any effect what so ever. The DockinPane behaves exactly as before, NOT setting the right Top for the Control.

If I use DockTopOf instead of DockRightOf the dockPane is placed at the top of the Form above the CommandBar. It seems like the DockPane always takes priority over the CommandBar, even though I load the CommandBar first. I am really puzzled about what to do, in what order

Bjarne

Back to Top
Bjarne View Drop Down
Newbie
Newbie
Avatar

Joined: 30 December 2003
Location: Denmark
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bjarne Quote  Post ReplyReply Direct Link To This Post Posted: 29 February 2004 at 6:15am

Found the Solution

I found a solution to the problem. It is the ZOrder that determines what takes priority. Right clikking on the CommandBar and choosing 'Bring to Front' solved the problem. Now it works as expected.

Not sure if this is a bug, but at least it should be mentioned in the Documentation.

Thanks again for your help SuperMario

Bjarne

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: 29 February 2004 at 11:37am
I see what you mean, I sent the CommandBar to the back and my docking panes were docked above the CommandBar.  But you should still need that line of code I posted above when using CommandBar and DockingPane in the same application.  Take it out and you will see what I mean.  I wasn't aware of the ZOrder problem, this sounds like a bug to me.  When you take that line out your docking pane should be docked under the CommandBar, this is what I thought you were talking about.

Edited by SuperMario
Back to Top
Bjarne View Drop Down
Newbie
Newbie
Avatar

Joined: 30 December 2003
Location: Denmark
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bjarne Quote  Post ReplyReply Direct Link To This Post Posted: 29 February 2004 at 12:29pm

No you where absolutely right. Without the DockingPaneManager.SetCommandBars Me.CommandBars this will not work, but if the ZOrder is not right, it does not work no matter what you do.

So if I set the above one line command, AND get the ZOrder right it works.

Thanks again,

Bjarne

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: 29 February 2004 at 12:51pm
Is sounds like a ZOrder method needs to be added to the CommandBars, DockingPanes, and PropertyGrid controls.  I have been searching through the help and haven't sounds anyting like this so far.
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.