Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - CommandBar and TaskPanel alignment
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CommandBar and TaskPanel alignment

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

Joined: 13 March 2011
Location: UK
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote rogue Quote  Post ReplyReply Direct Link To This Post Topic: CommandBar and TaskPanel alignment
    Posted: 30 March 2011 at 11:46am
Hi

I am new to the suite which is excellent by the way! I am trying to have a Task Panle and a menu on my main MDI form.

The menu and taskpanel will disappear once a choice is made and a child form is loaded.

My taskpanel (tskmain) works fine and is aligned left.

I have lifted your default code for createing the 'activemenu' as below.  My CommandBars object is called cmdMain.

My taskpanel is set to align left and it does that but it overlaps the created menu bar.

If I create a child form it occupys the client space I'd expect (ie. it doesn't go over the menu).

I've looked through various samples and tried to search the forum for this but can't pin down anything that seems to instruct the taskpanel to relinquish the space for the menu

I'm not doing anything with a 'resize' call for either the MDI form or the CommandBars/TaskPanel - possibly I should be? 

The sample called CommandBarsMDISample looked very similar to what I want in the sense there are menu bars and a taskpanel but this works fine on my machine, the taskpanel's top is just under the menu and toolbar but the bit of code that instructs the taskpanel to behave eludes me.

--


Dim Control As CommandBarControl
Dim ControlFile As CommandBarPopup, ControlEdit As CommandBarPopup
Dim ControlView As CommandBarPopup
Dim ControlWindow As CommandBarPopup, ControlHelp As CommandBarPopup

    Set ControlFile = cmdMain.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, _
    "&File", -1, False)

    With ControlFile.CommandBar.Controls
        Set Control = .Add(xtpControlButton, ID_FILE_NEW, "&New", -1, False)

        Set Control = .Add(xtpControlButton, ID_FILE_OPEN, "&Open", -1, False)

        .Add xtpControlButton, ID_FILE_CLOSE, "&Close", -1, False

        .Add xtpControlButton, ID_FILE_SAVE, "&Save", -1, False

        Set Control = .Add(xtpControlButton, ID_FILE_PRINT, "&Print", -1, False)

        Control.BeginGroup = True

        .Add xtpControlButton, ID_FILE_PRINT_SETUP, "Print Set&up...", -1, False

        Set Control = .Add(xtpControlButton, ID_FILE_EXIT, "&Exit", -1, False)

        Control.BeginGroup = True
    End With

    tskMain.Groups.Clear
  ... code continues here to create tasks in the task panel ... works fine

Thanks

Simon


Back to Top
rogue View Drop Down
Newbie
Newbie
Avatar

Joined: 13 March 2011
Location: UK
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote rogue Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2011 at 12:05pm
Have experimented a bit more and noted the following.

1)  If the CommandBars object is on the MDI form then I see a blank menu strip across the regardless of whether I code anything against it or not.

2) If the CommandBars object is present the statusbar object I already had present disappears but the TaskPanel  still allows space for it.

I am programming in VB6 btw.

Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2011 at 3:40am
Hi,

If you are using the TaskPanel directly on the MDI Form then this is why it's not working as per the MDI Sample. If you notice the wndTaskPanel in the MDI Sample is a PictureBox control and not an actual TaskPanel control.

Therefore if you put a PictureBox control on the screen first and align this left then place your TaskPanel control inside of this it should resolve your issue with the CommandBars.
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)
Back to Top
rogue View Drop Down
Newbie
Newbie
Avatar

Joined: 13 March 2011
Location: UK
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote rogue Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2011 at 3:59am
Hi

Thanks for that.  You're right I had just 'assumed' task panel controls were in the sample because they named them that way! Doh!

I've changed things as you suggested but now my picturebox (aligned left) is sitting inside my menubar when the form loads.  Obviously that makes it very shallow so the task panel can't really be seen.

Thanks

Simon





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: 31 March 2011 at 10:37am
Try adding the following code to the CommandBars_RepositionAlignedControls event assuming you name your TaskPanel "wndTaskPanel" (or picturebox if you go that route):

Private Sub CommandBars_RepositionAlignedControls(Left As Long, Top As Long, Right As Long, Bottom As Long)

    CommandBars.MoveAlignedControl wndTaskPanel, Left, Top, Right, Bottom

End Sub 
Back to Top
rogue View Drop Down
Newbie
Newbie
Avatar

Joined: 13 March 2011
Location: UK
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote rogue Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2011 at 11:49am
Mike

Thanks for that excellent bit of advice.  That call works great and I now have my taskpanel and picturebox (that will be a statusbar soon) sitting where they should be.

Bit confused as to how the MDISample works though as I can't find that call within the code?

Thanks, I can move on with my menus now.

Simon




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.188 seconds.