Disable ToolStrip

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
 
T

Techno_Dex

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();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top