When performing a rebuild the designer would freeze and wouldn't redraw the toolbar. The fix I discovered solves the problem where the designer disposes the object and then attempts to access it after the rebuild.
public class CustomButtonToolStripHost : ToolStripControlHost
{
public CustomButtonToolStripHost ()
: base(CustomToolStripButton())
{
}
///
private class CustomToolStripButton : Button // Replace with your control
{
///
/// This occurs when the designer updates after a rebuild.
protected override void CreateHandle()
{
if (!IsDisposed)
{
base.CreateHandle();
}
}
}
}
No comments:
Post a Comment