Jump to content

Disabling a button while mouse is over it results in stuck blue border.


buzzdx
 Share

Go to solution Solved by Josh,

Recommended Posts

In my project I created a button to delete items. When the button is pressed and the item gets deleted the button will be turned off/disabled. Since the mouse is still over the button when it gets disabled, the button will then keep its blue border even when the mouse moves out of it afterwards. So it seems like it's not detecting the loss of focus while being disabled.

However, it will lose the stuck border as soon as I click on anything else in the window.

I tried this to overcome the problem:

// first try to fix it
btn->SetState(false);
btn->Redraw();

// trying to emit the mouseleave, but I think it can't get handled before the next line of code. either way has no effect.
EmitEvent(Event(EVENT_MOUSELEAVE, btn));

btn->Disable();

// try to fix and redraw after disabling, no effect
btn->SetState(false);
btn->Redraw();

but nothing worked so far.

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...