Thread1 = new Thread(()=>UpdateLabel(ref label1));
Thread1.Start();
void UpdateLabel(ref Label _label1)
{
lock(_label1)
{
_label1.Text = "Hello World";
}
}
I thought that would make it a resource shared between the GUI thread and Thread1.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jan 7, 2013, 5:15 AM EST
I created new winform app. Added one label Label1 in UI.
In code behind
it is working fine
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jan 7, 2013, 5:10 AM EST