Print Page | Close Window

Command Bars

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=16892
Printed Date: 06 October 2024 at 7:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Command Bars
Posted By: SteveStraley
Subject: Command Bars
Date 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



Replies:
Posted By: Squale
Date Posted: 01 July 2010 at 2:51am
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


Posted By: Hemesh
Date Posted: 13 September 2010 at 5:19pm
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


Posted By: shipwreck
Date Posted: 13 September 2010 at 9:02pm
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


Posted By: Hemesh
Date Posted: 14 September 2010 at 5:04am
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


Posted By: Hemesh
Date Posted: 14 September 2010 at 9:02am
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


Posted By: Hemesh
Date Posted: 14 September 2010 at 4:11pm
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



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