Click here to Skip to main content
Click here to Skip to main content
Alternative Tip/Trick

Tagged as

Changing a WinForms Control on the 'UI' Thread from another Thread

, 22 Aug 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Doing like following for few years now :public void AnyMethod(int parameter){ var wrapper = new Action(()=> { // Do your thing here! }); if (this.InvokeRequired) this.Invoke(wrapper); else wrapper();}
Doing like following for few years now :
 
public void AnyMethod(int parameter)
{
    var wrapper = new Action(()=>
    {
        // Do your thing here!
    });
    if (this.InvokeRequired)
        this.Invoke(wrapper);
    else
        wrapper();
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Moim Hossain
Architect BlueCielo ECM Solutions
Netherlands Netherlands
Just another developer.
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 23 Aug 2010
Article Copyright 2010 by Moim Hossain
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid