Click here to Skip to main content
12,292,619 members (66,103 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

2.6K views
2 bookmarked
Posted

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.

You may also be interested in...

Comments and Discussions

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