Hello,
I need to enable a toolbar button in run-time. The button is invisible and disabled at the time when the toolbar is created.
The code makes it enabled but the button is not re-drawn at the enabled state:
ButtonTool save = (ButtonTool)ultraToolbarsManager1.Toolbars["toolbar"].Tools["Save"];save.SharedProps.Enabled = true;
The call of Invalidate(Rectangle) of the parent view class doesn't re-draw it as well as save.UIElement.Invalidate(true)
It's interesting thing that if to move mouse cursor over the button then it's re-drawn correctly and starting from the moment is alway re-drawn when I do
save.SharedProps.Enabled = true or false.
How to make it re-drawn without any mouse moving?
Thanks,
Andre
This sounds like a bug. I would recommend submitting the issue to the support group: http://www.infragistics.com/gethelp. As a workaround, you can temporarily move the mouse over the button and then back again to force a mouse over (untested code):
Rectangle saveScreenRect = save.UIElement.Control.RectangeToScreen( save.UIElement.Rect );Point tempCursorPoint = new Point( saveScreenRect.X + 1, saveScreenRect.Y + 1 );Point originalCursorPoint = Cursor.Position;Cursor.Position = tempCursorPoint;Cursor.Position = originalCursorPoint;
Mike,
Thanks for fast response.
Actually one temporary mouse move is not enough. It's necessary to hold the cursor over the button during some time while.
The following code fixed the issue:
{
}
});
t.Start(saveScreenRect);
t.Join();
Andre Romanov