11-08-2024, 01:48 PM
Thank you for showing the workaround.
My toolbars are running in separate threads and I'm storing the created instances of each toolbar in a static dictionary and access them later by unique names.
If I try to update the button text by calling toolbar.DisplayText ^= true twice I receive an wrong thread exception as follows:
System.InvalidOperationException: Wrong thread.`n at Au.Types.MTBase._ThreadTrap()
I am already using the option Triggers.Options.ThreadOfTriggers(); to create the toolbar triggers.
Is there any other chance (via windows message?) to invalidate and force redraw of that toolbar from other thread too?
Otherwise I might have to rewrite the business logic either by using the tag-property of toolbar to store the needed information within the same thread as the toolbar itself or by writing a wrapper class.
My toolbars are running in separate threads and I'm storing the created instances of each toolbar in a static dictionary and access them later by unique names.
If I try to update the button text by calling toolbar.DisplayText ^= true twice I receive an wrong thread exception as follows:
System.InvalidOperationException: Wrong thread.`n at Au.Types.MTBase._ThreadTrap()
I am already using the option Triggers.Options.ThreadOfTriggers(); to create the toolbar triggers.
Is there any other chance (via windows message?) to invalidate and force redraw of that toolbar from other thread too?
Otherwise I might have to rewrite the business logic either by using the tag-property of toolbar to store the needed information within the same thread as the toolbar itself or by writing a wrapper class.