SetRecentItem
PowerScript function
Description
Sets a recent menu item for the application menu in the RibbonBar
control.
Applies to
Syntax
|
1 |
controlname.SetRecentItem ( Long Index, RibbonMenuItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonApplicationMenu control in which you |
|
Index |
The index of the recent menu item for which you want to |
|
Item |
A RibbonMenuItem item you want to set. Only RibbonMenuItem |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, returns null.
Usage
Only the menu item with the “Recent” type (that is RibbonMenuItem
with ItemType 2) can be added as a recent menu item.
The recent menu can have only one level; and can contain no more
than 9 items.
The user events to be bound with the recent menu item must be
defined correctly according to the requirements of RibbonMenuItem. For
details, see Clicked in PowerScript Reference and Selected in PowerScript Reference.
Examples
This example inserts the “RecentItem1” recent menu item and binds it
with the “Ue_RecentItem1Clicked” user event, and then changes the text of
this item to “RecentItem2” and the bound user event to
“Ue_RecentItem2Clicked”.
|
1 2 3 4 5 6 7 8 9 10 |
Integer li_Return Long ll_Index RibbonApplicationMenu lr_AppMenu RibbonMenuItem lr_MenuItem ll_Index = lr_AppMenu.InsertRecentItemFirst("RecentItem1", "Ue_RecentItem1Clicked") lr_MenuItem.ItemType = 2 lr_MenuItem.Text = "RecentItem2" lr_MenuItem.Clicked = "Ue_RecentItem2Clicked" li_Return = lr_AppMenu.SetRecentItem(ll_Index, lr_MenuItem) |
See also