Jonnster
Jonnster

Reputation: 3214

Update WinForm From Non-Member Thread Process

I know how to update a winform when the thread method is a member of the WinForm class using delegates. But how does this work if the thread function is not a member of the WinForm? How do you do it in this case?

Upvotes: 0

Views: 145

Answers (1)

Alex F
Alex F

Reputation: 43311

In this case you need form reference in the thread function. Using this reference, you can call any public form method, and update the form by the same way as from class member.

It's up to you to decide, how to pass form reference to the thread function. Obvious way is to do this using function parameter.

Upvotes: 1

Related Questions