none
MS Excel Ribbon Click event 2007 RRS feed

Answers

  • Hello,

    You could handle RibbonComboBox.ItemsLoading Event to load the items. The event occurs when the drop-down list for this RibbonComboBox is opened.

    E.g.

    private void comboBox1_ItemsLoading(object sender, RibbonControlEventArgs e)
            {
                System.Windows.Forms.MessageBox.Show("Load");
                if ((comboBox1.Items.Count == 0))
                {
                    RibbonDropDownItem item = Globals.Factory.GetRibbonFactory().CreateRibbonDropDownItem();
                    item.Label = "First Name";
                    comboBox1.Items.Add(item);
                }
            }
    

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by StSingh Friday, April 7, 2017 8:59 AM
    Thursday, April 6, 2017 4:14 AM
    Moderator

All replies

  • Hello,

    You could handle RibbonComboBox.ItemsLoading Event to load the items. The event occurs when the drop-down list for this RibbonComboBox is opened.

    E.g.

    private void comboBox1_ItemsLoading(object sender, RibbonControlEventArgs e)
            {
                System.Windows.Forms.MessageBox.Show("Load");
                if ((comboBox1.Items.Count == 0))
                {
                    RibbonDropDownItem item = Globals.Factory.GetRibbonFactory().CreateRibbonDropDownItem();
                    item.Label = "First Name";
                    comboBox1.Items.Add(item);
                }
            }
    

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by StSingh Friday, April 7, 2017 8:59 AM
    Thursday, April 6, 2017 4:14 AM
    Moderator
  • Thanks Celeste Li. Code snippet was of great help.
    Friday, April 7, 2017 9:00 AM