none
How to call a function when custom panels 'x' button is clicked RRS feed

  • Question

  • Hey I am having an issue where my ribbon text does not update when a custom panel is closed. I cannot find any handler or anything in my code that is hit when the user clicks the 'x' on top of the custom panel. Has anyone run into this before?
    Thursday, October 5, 2017 4:06 PM

All replies

  • Hi seamo123,

    I would suggest you handle CustomTaskPane.VisibleChanged Event.

    Here is an example in excel.

    myCustomTaskPane.VisibleChanged += MyCustomTaskPane_VisibleChanged;

    private void MyCustomTaskPane_VisibleChanged(object sender, EventArgs e)

            {

                if (!myCustomTaskPane.Visible) {

                    MessageBox.Show("Custom Task Pane is closed");

                }          

            }

    Best Regards,

    Terry


    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.

    Friday, October 6, 2017 2:13 AM
  • Hello,

    Do you resolve your issue?

    If your issue persists, please try to use IRibbonUI.Invalidate method to refresh the ribbon controls.

    If it doesn't work, what code do you use to update ribbon text in the custom pane?

    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.

    Monday, October 30, 2017 9:12 AM
    Moderator