Try this
Application.ScreenUpdating = false;
set it back to true at the end of your process.
MSDN link
Pregunta
I have an addin developed in VSTO and as soon as the wait cursor appears and if I click on the other button the click event is fired even in the wait cursor.
How can I disable this event click unless the process is completed?
public bool Part3DVis_Click(Office.IRibbonControl control)
{
xtnvis.HelpNamespace = mobjGlobalConfig.HelpFilenamePath;
xtnvis.tabConrolVisUpdateHelpKeyword();
excelComponent.Part3DVis_Click();
return true;
}
When this event is clicked i need rest of the control n event of other forms to be disable, and after it is returned true, it should enable all the events. How can I do this?
Solución
Try this
Application.ScreenUpdating = false;
set it back to true at the end of your process.
MSDN link