Print Page | Close Window

CommandBar and TaskPanel alignment

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=18141
Printed Date: 06 October 2024 at 2:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandBar and TaskPanel alignment
Posted By: rogue
Subject: CommandBar and TaskPanel alignment
Date 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





Replies:
Posted By: rogue
Date 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.



Posted By: Xander75
Date 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)


Posted By: rogue
Date 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







Posted By: SuperMario
Date 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 


Posted By: rogue
Date 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







Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net