Well, if you are working with threads and want to access a control that is created in another thread then you will always face a problem saying that:To solve the tiny problem, Here is the solutionFirst of all start the thread and assign it a method you want to execute it on.Remember, the method you want to assign to the thread should not contain any parameters.Now here is the RunLoop methodIn the first line we get to know whether the control we want to access is created on the same thread or another thread. If it's created on another thread then it will execute the second line.In the second line we create a MethodInvoker with the name of AssignMethodToControl which is a delegate that executes a method that has no parameters.In the third line we invoke the MethodInvoker to the Control.We have achieved our aim so the method will re-execute and it will loop through condition.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: