11-08-2024, 11:48 AM
(This post was last modified: 11-08-2024, 11:49 AM by AutoStarter.)
I have an C# program and use the latest nuget package of LibreAutomate 1.5.0 to automate windows using toolbar triggers.
I have several submenus with radiobuttons in toolbars and want to update the choosen item text in the parent toolbar button (toolbarItem.Text = "Update") while the toolbar stays open.
I found in code the following Update function in decompiled toolbar code which should take care of redraw:
private void _Invalidate(TBItem ti = null) {
_ThreadTrap();
if (IsOpen) {
if (ti != null) {
Api.InvalidateRect(_w, ti.rect);
}
else {
Api.InvalidateRect(_w);
}
}
Unfortunately the redraw happens only if I move the mouse over the button.
What shall I do to redraw the changed button without mouseover?
Has it something to do with threading?
I have several submenus with radiobuttons in toolbars and want to update the choosen item text in the parent toolbar button (toolbarItem.Text = "Update") while the toolbar stays open.
I found in code the following Update function in decompiled toolbar code which should take care of redraw:
private void _Invalidate(TBItem ti = null) {
_ThreadTrap();
if (IsOpen) {
if (ti != null) {
Api.InvalidateRect(_w, ti.rect);
}
else {
Api.InvalidateRect(_w);
}
}
Unfortunately the redraw happens only if I move the mouse over the button.
What shall I do to redraw the changed button without mouseover?
Has it something to do with threading?