sanchop22
sanchop22

Reputation: 2809

Threadsafe treeview node image index change in C#

How can i change image index of a tree view node in a threadsafe manner? There is no Invoke() method for TreeNode class.

Upvotes: 0

Views: 371

Answers (1)

Polynomial
Polynomial

Reputation: 28316

You can call Invoke on the form instead of the component itself.

Component code executes on the thread of the form, so an invoke on a component simply delegates the operation to the form's thread. You'll get exactly the same result by using form.Invoke as you would form.component.Invoke.

Upvotes: 3

Related Questions