CommandBar and TaskPanel alignment |
Post Reply |
Author | |
rogue
Newbie Joined: 13 March 2011 Location: UK Status: Offline Points: 6 |
Post Options
Thanks(0)
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 |
|
rogue
Newbie Joined: 13 March 2011 Location: UK Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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. |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
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) |
|
rogue
Newbie Joined: 13 March 2011 Location: UK Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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 |
|
rogue
Newbie Joined: 13 March 2011 Location: UK Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |