Recent documents |
Post Reply |
Author | ||
JvdH
Groupie Joined: 09 May 2008 Status: Offline Points: 50 |
Post Options
Thanks(0)
Posted: 12 January 2011 at 4:16pm |
|
Is it possible to add an item to the recent documents list on runtime (after the Ribbonbar is created)?
Is it possible to open the systembutton control to execute the following:
Set control = frmMain.CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListItem")
control.Caption = "test" control.Id = 1004 .AddControl control
Or am I thinking in a total wrong direction?
Thank you in advance :).
|
||
Product: Xtreme SuitePro (ActiveX) version 13.2.1
Platform: Windows 7 (64bit) Language: Visual Basic 6.0 SP6 |
||
JvdH
Groupie Joined: 09 May 2008 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
|
So, nobody has a solution for this?
|
||
Product: Xtreme SuitePro (ActiveX) version 13.2.1
Platform: Windows 7 (64bit) Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Something like this?
or maybe more concise if you don't specifically need a CXTPRibbonControlSystemPopupBarListItem:
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
|
Hi
jpbro solution may be better, but I have just spent the last 1/2 hour trying to find a way for you, so I will post what I found.
Working from the codejock Ribbon Sample vbp,
I had to add an Id to the ControlFile
Set ControlFile = RibbonBar.AddSystemButton()
ControlFile.Id = 50 Then from a button just place on the form I run
Private Sub Command1_Click()
Dim Control As CommandBarControl Dim ControlFile As CommandBarPopup Dim RibbonBar As RibbonBar Set RibbonBar = CommandBars.ActiveMenuBar Set ControlFile = RibbonBar.FindControl(, 50) With ControlFile.CommandBar.Controls Set Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListItem") Control.Caption = "frmMain3.frm" .AddControl Control End With End Sub Hope that makes sence, what took me awhile to find was the CommandBars.ActiveMenuBar
which gives you the RibbonBar object
Mark |
||
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
||
JvdH
Groupie Joined: 09 May 2008 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
|
Hey Mark and JPBro, thank you for your help. I'm really appreciating this!
Can't thank you guys enough :)
Is there another way to delete an item from the list?
Created this for now (reloading the whole menu):
Private Function Reload_SystemMenu()
frmMain.ControlFile.CommandBar.Controls.DeleteAll Dim lo_Control As CommandBarControl
With frmMain.ControlFile.CommandBar.Controls
.Add xtpControlButton, ID_NEW, LANG_ID_NEW .Add xtpControlButton, ID_DELETE, LANG_ID_DELETE End With Set lo_Control = frmMain.CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListCaption")
With lo_Control lo_Control.Caption = "Filelist" lo_Control.BeginGroup = True lo_Control.Id = ID_FILELIST End With frmMain.ControlFile.CommandBar.Controls.AddControl lo_Control If tmpStrg <> "" Then
FileName = Left$(tmpStrg, Len(tmpStrg) - 4) Set lo_Control = frmMain.CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListItem")
With lo_Control lo_Control.Caption = FileName lo_Control.Id = ID_FILENAME End With frmMain.ControlFile.CommandBar.Controls.AddControl lo_Control tmpStrg = Dir$ End If Set lo_Control = frmMain.CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarButton")
With lo_Control lo_Control.Caption = "Exit " & M_APP_NAME_LONG lo_Control.Id = ID_EXIT End With frmMain.ControlFile.CommandBar.Controls.AddControl lo_Control End Function |
||
Product: Xtreme SuitePro (ActiveX) version 13.2.1
Platform: Windows 7 (64bit) Language: Visual Basic 6.0 SP6 |
||
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
|
Hi
Not to sure if I am helping here, but Command1_Click adds and Command2_Click deletes
all I had to add from my previous example was an id =23, then find it and delete it.
Private Sub Command1_Click()
Dim Control As CommandBarControl Dim ControlFile As CommandBarPopup Dim RibbonBar As RibbonBar Set RibbonBar = CommandBars.ActiveMenuBar Set ControlFile = RibbonBar.FindControl(, 50) With ControlFile.CommandBar.Controls Set Control = CommandBars.CreateCommandBarControl("CXTPRibbonControlSystemPopupBarListItem") Control.Caption = "frmMain3.frm" Control.Id = 23 .AddControl Control End With End Sub Private Sub Command2_Click() Dim Control As CommandBarControl Dim ControlFile As CommandBarPopup Dim RibbonBar As RibbonBar Set RibbonBar = CommandBars.ActiveMenuBar Set ControlFile = RibbonBar.FindControl(, 50) With ControlFile.CommandBar.Controls Set Control = .Find(, 23) Control.Delete End With End Sub
|
||
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
||
JvdH
Groupie Joined: 09 May 2008 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
|
Hey Mark,
Thanks for your reply.
All the items have the same ID on my list. This would not work for deleting just record.
|
||
Product: Xtreme SuitePro (ActiveX) version 13.2.1
Platform: Windows 7 (64bit) Language: Visual Basic 6.0 SP6 |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
You really should give all of your items a unique ID, as it does make things easier - but assuming that you are keeping track of the recent file names, you can remove them by Caption. Here's an example based on my previous example:
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
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 |