Print Page | Close Window

Change or Remove Controls in the File menu

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


Topic: Change or Remove Controls in the File menu
Posted By: randallmking
Subject: Change or Remove Controls in the File menu
Date Posted: 29 December 2008 at 5:54pm

How do I change or remove a button caption from the Recent Documents list of the File menu of a Ribbonbar Control? What event is fired that I can intervene to update the Recent Documents list for the File Menu.

I start with this during the Form_Load:
 
Set ControlFile = Ribbonbar.AddSystemButton()
....
Set Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListCaption")
Control.Caption = "Recent Documents"
Control.BeginGroup = True
ControlFile.CommandBar.Controls.AddControl Control
      
 Set Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListItem")
Control.ID = ID_File_History_1
Control.Caption = FileHistory(i&)
....
 
Then I need to know which event to track so I can change/remove the captions of the Recent Documents controls so users can see a list of the recent files they have opened. I have this code:
 
Set Control = .Find(xtpControlButton, ID_File_History_1)
Control.Caption = "(Last Filename)"
 
but I don't know where to put it. What event is fired before the File menu is launched?
 
Is there a better way to code this so I don't need to access/find the controls with static IDs ( ID_File_History_1, ID_File_History_2,...)? Can I just loop thru all my Recent Document controls to change the captions without using an ID? 

Also, is there a good tutorial on Actions?  



Replies:
Posted By: Oleg
Date Posted: 30 December 2008 at 12:55am
Hi,

Guess best event InitCommandsPopup - fired before Popup appeared.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: randallmking
Date Posted: 30 December 2008 at 7:58am
CommandBars_InitCommandsPopup routine is called for all Popup controls. How do I know when the File meu control is selected?
 
Private Sub CommandBars_InitCommandsPopup(ByVal CommandBar As XtremeCommandBars.ICommandBar)

End Sub

Also, is there a better way to code this so I don't need to access/find the controls with static IDs ( ID_File_History_1, ID_File_History_2,...)? Can I just loop thru all my Recent Document controls to change the captions without using an ID? 




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