I have a CustomTaskPane
in my VSTO project that I can show/hide using .Visible = true/false
property. However it's an ordinary showing/hiding element with no animation whatsoever.
However the "Smart Lookup" button, that comes with Excel 2016, also opens an Excel Pane by sliding left/right.
I guess that the Smart Lookup addin is built in the newer technology using JavaScript instead of the outdated VSTO COM plugin and thus might have such feature.
Am I able to have it in the VSTO plugin as well?
It's the default behavior beginning with Excel 2013, that the task panes slide in / out. But this can be disabled in the registry, see Disable Excel 2013 cell animation:
Please check that the registry setting is set to "DisableAnimations = 0"
Then all your custom task panes should be slided in / out when setting visible true / false.
To achieve this you need to install KB3114383. With this KB installed, you can disable animations only for Custom Task Panes by changing the following registry key (depending on you your Microsoft Office version: 15.0 = 2013, 16.0 = 2016):
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Toolbars
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Toolbars
Add the following DWORD value:
DisableWindowTransitionsOnAddinTaskPanes
... and set its value to 1. All other animations, even native task pane (such as Format Chart Area) animations, will remain unchanged. More info here.
来源:https://stackoverflow.com/questions/39857254/slide-animation-when-showing-hiding-customtaskpane-in-vsto