xtd 0.2.0
Loading...
Searching...
No Matches

◆ check_for_illegal_cross_thread_calls() [2/2]

static void xtd::forms::control::check_for_illegal_cross_thread_calls ( bool  value)
static

Sets a value indicating whether to catch calls on the wrong thread that access a xtd::forms::contrtol::handle property when an application is being debugged.

Parameters
valuetrue if calls on the wrong thread are caught; otherwise, false.
Remarks
When a thread other than the creating thread of a control tries to access one of that control's methods or properties, it often leads to unpredictable results. A common invalid thread activity is a call on the wrong thread that accesses the xtd::forms::control::handle property. Set xtd::forms::control::check_for_illegal_cross_thread_calls to true to find and diagnose this thread activity more easily while debugging.
Warning
Be careful, some OS don't support cross-thread UI operations!