Hello,
a ribbon related question: how to get a current item of a LargeButton menu?
Consider a LargeButton with a menu:
<LargeButton Text="Button" PictureName="" DefaultCommand="false" Tag="button" PowerTipText="" PowerTipDescription="" Visible="true">
<Menu>
<Item Text="item 1" PictureName="" Clicked="ue_click" Tag="item1" Shortcut=""/>
<Item Text="item 2" PictureName="" Clicked="ue_click" Tag="item2" Shortcut=""/>
</Menu>
</LargeButton>
Let's set current item of a menu as item2:
RibbonLargeButtonItem lr_LargeButton
RibbonMenuItem lmi_item
RibbonMenu lm_menu
int li_i
if this.getitembytag('button', ref lr_LargeButton) = 1 then
if lr_LargeButton.getmenu(ref lm_menu) <> 1 then return -1
for li_i = 1 to lm_menu.getitemcount()
lm_menu.getitem(li_i, lmi_item)
if lmi_item.tag = 'item2' then
// set menu item
lmi_item.visible = ab_visible
this.setitem(lmi_item)
// set menu
lm_menu.setitem(li_i, lmi_item)
this.setitem(lm_menu)
// set button
lr_LargeButton.setmenu(lm_menu)
this.setitem(lr_LargeButton)
exit
end if
next
end if
And now...how to tell if the current item of LargeButton is item1 or item2? I am able to obtain a button menu, but I don't know how to find out which item is selected. Maybe I am missing something elementary?
Regards,
Tomáš
thanks. It looks promising, I will try it.
Regards,
Tomáš