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

Command Bars

 Post Reply Post Reply
Author
Message
SteveStraley View Drop Down
Groupie
Groupie


Joined: 25 November 2005
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote SteveStraley Quote  Post ReplyReply Direct Link To This Post Topic: Command Bars
    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
Back to Top
Squale View Drop Down
Groupie
Groupie


Joined: 29 April 2009
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Squale Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post 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
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.156 seconds.