O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to Access Windows Controls from Non-UI Threads

If you want to access controls in your main application from a different thread, consider the following: because controls are not thread-safe, you can use them only through the thread that initially created the controls. This is usually the main thread of the application that contains the user interface. This thread is also called the UI thread.

Remember that each Windows application runs in an infinite loop that terminates only after the main window is closed. For the application to manage events properly, it can’t let multiple threads access a control and change its properties—such changes must occur successively on a single thread. If you use a different thread to update a control, the main ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required