How to prevent the error while updating ui control from another thread?
Answer / Sachin Varshney
To update a UI control safely from another thread, you can use Control.Invoke or Control.BeginInvoke:nnExample using Invoke:n```csharpn// Some code running on another thread
this.BeginInvoke((Action)(() => myControl.Text = "New Text"));n```
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between class and namespace?
Do while loops yes or no c#?
What is console writeline in c#?
What is the difference between serialization and deserialization in c#?
How long will it take to learn c sharp?
How big is an int in c#?
Does c# have its own class library?
Which control cannot be placed in mdi?
What are methods c#?
Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?
What?s the implicit name of the parameter that gets passed into the class? set method?
Why do we need singleton pattern in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)