Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

winforms C# code cross thread operation is not valid

UserContrl1_LOadDataMethod()
{
    string name = "";
    if(textbox1.InvokeRequired)
    {
        textbox1.Invoke(new MethodInvoker(delegate {
          name = textbox1.text; 
        }));
    }
    if(name == "MyName")
    {
        // do whatever
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# run cmd hidden 
Csharp :: c# enum syntax 
Csharp :: c# clamp 
Csharp :: unity string lowercase 
Csharp :: connection string in asp.net with username and password 
Csharp :: ajax asp.net core 
Csharp :: CS0101 Unity Error Code 
Csharp :: c# cancellationtoken example 
Csharp :: unity pause game c# 
Csharp :: unity call function from another script 
Csharp :: unity audio manager 
Csharp :: variable gameobject unity 
Csharp :: dictionary order by value c# 
Csharp :: Replaced OS is obselete 
Csharp :: C# default value for datetime parameter 
Csharp :: wpf color picker 
Csharp :: The entity type has multiple properties with the [Key] attribute. 
Csharp :: c# for statement 
Csharp :: unity call function on update once per second 
Csharp :: C# using variables inside strings 
Csharp :: get all components of type unity 
Csharp :: mvc write to console 
Csharp :: hwo to prevent rotation after hitting an object in unity 
Csharp :: c# quit button script 
Csharp :: vb.net add row to datagridview programmatically 
Csharp :: how to stop a form c# 
Csharp :: c# numbers only 
Csharp :: array reduce c# 
Csharp :: map user to ConnectionId SignalR 
Csharp :: how to iterate between hour range in c# 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =