User Interface Issues

In order to optimize performance of the User Interface (UI), both WinForms and VCL applications have not implemented any thread-safety mechanisms. Any updates to a control must occur from the main user-interface thread.

For WinForm applications, most methods of the System.Windows.Forms.Control class are not thread-safe. There are, however, four methods that are safe to execute from any thread. These methods are identified in the following sections. Listing 14.14 contains the methods and properties of interest for this section.

Listing 14.14. Thread-safe System.Windows.Forms.Control Methods
System.Windows.Forms.Control = class ( System.ComponentModel.Component, ISynchronizeInvoke, ...) public ... function Invoke(method: Delegate) ...

Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.