Command Bars |
Post Reply |
Author | |
SteveStraley
Groupie Joined: 25 November 2005 Status: Offline Points: 46 |
Post Options
Thanks(0)
Posted: 29 June 2010 at 5:07pm |
Hi Everyone,
I would like to have some advice. I have a commandbar control as the main menu of my application. Actions from that initial commandbar can open other windows within an MDI application. As each new window is activated (or as the user bounces from open window (document) to the next) I would like the main menu/commandbar to dynamically change. Are there examples of that on here or in the samples or does someone have an idea as to the best approach to take for this behaviour? Thanks in advance, Steve |
|
Squale
Groupie Joined: 29 April 2009 Status: Offline Points: 25 |
Post Options
Thanks(0)
|
I think you have all needed sample in "Ribbon MDI Sample".
"Edit" menu is activated only if document is open. "Cut" only if document open and text selected. |
|
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows XP (32bit) - SP 3 Language: Visual Basic 6.0 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
Hi there,
I'm trying to follow the sample, but can't seem to find out how to enable the relevant MDI menu when I open the relevant form. Am I missing something really obvious on the form that enables the MDI menu when the first document is opened? Thanks, Hemesh |
|
Product: Xtreme SuitePro (ActiveX) version 18.5.0
Platform: Windows 7 Enterprise (64-bit) Language: Visual Basic 6.0 |
|
shipwreck
Senior Member Joined: 18 April 2008 Location: United States Status: Offline Points: 308 |
Post Options
Thanks(0)
|
I don't think the Ribbon MDI sample has what your looking for.
There is another sample simply entitled "MDI Sample" that uses the more traditional menubar/tor rather than the ribbon. It may also explain better. let me know if that helps. :] |
|
Product: Xtreme Suite Pro (Active-X), Version 15.3.1
Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit) Language: Visual Basic 6.0 SP6 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
Apologies shipwreck, that's actually the one I was looking at and not the Ribbon One.. d'oh! So, nope it doesn't help me :(
I am able to switch the menu and set the MDI client property of the CommandBar control to be the hWd of the form i'm displaying but I'm not too sure how to switch back to the active commandbar when I close the form ... in saying that though, the MDI Sample doesn't even need to do that so I'm missing something obvious! The only different thing to the MDI Sample that I am using is that I have a CommandBarsFrame control instead of the CommandBars control, and thats mainly to preserve the docking of my OutlookBar (it's not CJ) on the right pane. Think this may have a bearing on things? Thanks |
|
Product: Xtreme SuitePro (ActiveX) version 18.5.0
Platform: Windows 7 Enterprise (64-bit) Language: Visual Basic 6.0 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
Oo... think I've discovered the obscure reason for the automatic menus after seeing this bit of code...
Private Sub CommandBars_GetActiveDocumentID(Id As Long) If Not ActiveForm Is Nothing Then Id = ActiveForm.HelpContextID End If End Sub Changing that ID on the document form no longer displays the correct menu, think that's the business! Please CJ, mention this in comments somewhere on the example for other noobs like me to understand EDIT: Scrap that... I've done this but it still didn't work |
|
Product: Xtreme SuitePro (ActiveX) version 18.5.0
Platform: Windows 7 Enterprise (64-bit) Language: Visual Basic 6.0 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
Right, further info on this...
The GetActiveDocumentID event fires with a CommandBars Control, but not with the CommandBarsFrame Control... what's going on?!!?? The same happens if I stick the CommandBars Control in a picturebox on an MDI form.... very strange.. |
|
Product: Xtreme SuitePro (ActiveX) version 18.5.0
Platform: Windows 7 Enterprise (64-bit) Language: Visual Basic 6.0 |
|
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 |