WindowSelectionChange & Undo RRS feed

  • Question

  • Hi,

       I'm using the application event WindowSelectionChange to update the ribbon accordingly the mouvement of the cursor by the user.

    I'm able to "tell" the procedure/event to avoid the calculation needed and the refreshing of the ribbon when I'm performing some change of selection programmatically.

    I would like to do the same when the user is undoing my block of code inside an UndoRecord using the Undo button. But how can I know when this is the case since the Undo Button is not repurposable?

    By the way why the undo triggers the WindowSelectionChange event more times then "the doing"?

    Thanks, Lauro

    Saturday, February 18, 2012 5:09 PM

All replies

  • Hi Lauro,

    Before I give you some suggestions, do you mind I asking you several questions to confirm your requirement?

    You want to monitor the enable state of the Undo control, and if it changes, you want to invalidate your custom controls to update the sate of them according to the Undo control, right?

    But as as far as I can see, there is no easy way to retrieve state of a built-in control and then monitor it. If it is what you are trying to do, you might need to re-consider its possibility.

    I look forward to hearing of you.

    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 20, 2012 9:02 AM
  • Thanks Calvin for your interest.

    Yes, I would like to know when an Undo process starts and ends.

    I would like to know this because I don't want to perform the WindowSelectionChange code when a user is undoing a group of code actions. And this for two reasons

    1. avoid not necessary calculations
    2. avoid that the program crashs, as it does!!!

    Thanks, Lauro

    Monday, February 20, 2012 2:48 PM