Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
How to make ButtonTool to redraw when Enabled is changed
posted

 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

Parents
  • 44743
    Verified Answer
    posted

    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;

Reply Children
No Data