Invoke(Delegate)

后端 未结 9 1147
误落风尘
误落风尘 2020-11-22 16:33

Can anybody please explain this statement written on this link

Invoke(Delegate):

Executes the specified delegate on the thread that owns th

9条回答
  •  广开言路
    2020-11-22 16:43

    It means that the delegate you pass is executed on the thread that created the Control object (which is the UI thread).

    You need to call this method when your application is multi-threaded and you want do some UI operation from a thread other than the UI thread, because if you just try to call a method on a Control from a different thread you'll get a System.InvalidOperationException.

提交回复
热议问题