.NET.this thread call vs .control

I noticed that when "focusing" returns to your main thread, when called from another thread, you can either call "this" or the control you want to use is good to call. I noticed that it doesn’t matter when you give up control, so can someone explain why I would call control over the main thread? Does it matter, or is the main thread implicitly called?

Would

this.Invoke(InvokedMethod,args)

differs from

button1.Invoke(InvokedMethod,args)

When button1 is in my main form.

+3
source share
2 answers

, , , . ( - , ), , UI ( ). , .

+2

Invoke Control.

, Control.

, Form, () Control. this.

, .

+2

Source: https://habr.com/ru/post/1729781/


All Articles