Change or Remove Controls in the File menu |
Post Reply |
Author | |
randallmking
Newbie Joined: 23 September 2008 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
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? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Guess best event InitCommandsPopup - fired before Popup appeared. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
randallmking
Newbie Joined: 23 September 2008 Location: United States Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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? |
|
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 |