How to set default value in dropdown control for Excel custom ribbon control

前端 未结 3 954
一向
一向 2021-02-09 00:54

I have created a custom Fluent Ribbon interface for Excel 2010 which includes a dropdown. Relevant XML code (simplified):



        
3条回答
  •  盖世英雄少女心
    2021-02-09 01:54

    I had a similar problem with the blank drop down at startup, as nothing was set yet. However, when the control was invalidated but the dropDown was already populated, it would again return the blank selection (I invalidated the control because I added some new items to the list, so I wanted it rebuilt).

    The solution, as mentioned here, is to use the

    Worked as expected. Note: the onAction= "onActionCallback" is used to set the state and broadcast it to whoever in VBA; the getSelectedItemIndex= "onGetSelectedItemIndexCallback" is use for the ribbon to query the state that it should be displaying.

提交回复
热议问题