Skip to content

.NET Library written in C# to access objects created in the UI thread from another thread.

License

Notifications You must be signed in to change notification settings

gcorthey/CrossThreadLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CrossThreadLib

.NET Library written in C# to access objects created in the GUI thread from another thread. This is used in order to avoid freezing of the GUI while running some processes, i. e. the GUI continues to be responsive to the user actions.

Example of the implementation to get the text property of any object of the GUI.

    public static string GetControlText(Control control)
    {
        string controlText = "";

        if (control.InvokeRequired)
        {
            control.Invoke((System.Action)(() =>
            {
                controlText = control.Text;
            }));
        }
        else
        {
            controlText = control.Text;
        }
        return controlText;
    }

About

.NET Library written in C# to access objects created in the UI thread from another thread.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages