Disable ToolStrip

  • Thread starter Thread starter Techno_Dex
  • Start date Start date
T

Techno_Dex

Does anyone know of a work around for getting a ToolStripButton to
refresh/repaint itself so that it does not show as selected after the
toolstrip is disabled? I have a toolstrip with a toolstripbutton on it.
Inside the click event handler I do some functionality, then I disable the
toolstrip and move the focus to another control within the form. The
problem is the toolstripbutton still remains painted as though I were still
hovering over it. This seams like a .NET bug to me and was wondering if
someone has a work around.

TIA
 
I may have found a work around but am still interested in other input.

private void mtsbToolBarButton_Click(object sender, EventArgs e)
{
//Do Work Here

this.BeginInvoke(new MethodInvoker(DisableToolStripButtonEdits));
}

private void DisableToolStripButtonEdits()
{
mtsbToolBarButton.Enabled = false;
mtsbToolBarButton.Enabled = true;
mtsbToolBarButton.Invalidate();
}
 
Back
Top