Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Change or Remove Controls in the File menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change or Remove Controls in the File menu

 Post Reply Post Reply
Author
Message
randallmking View Drop Down
Newbie
Newbie
Avatar

Joined: 23 September 2008
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote randallmking Quote  Post ReplyReply Direct Link To This Post Topic: Change or Remove Controls in the File menu
    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?  
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2008 at 12:55am
Hi,

Guess best event InitCommandsPopup - fired before Popup appeared.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
randallmking View Drop Down
Newbie
Newbie
Avatar

Joined: 23 September 2008
Location: United States
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote randallmking Quote  Post ReplyReply Direct Link To This Post 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? 

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.188 seconds.