1,105,333 Community Members

Modify form label from new thread

Member Avatar
Suzie999
Posting Pro in Training
461 posts since Jul 2010
Reputation Points: 78 [?]
Q&As Helped to Solve: 27 [?]
Skill Endorsements: 3 [?]
 
0
 

I have a form with 2 labels and 2 buttons

Button1 changes the label1.Text of the form // works fine

Button2 starts a new thread and the method is supposed to change label2.Text

However I get compile time error:

"error CS0120: An object reference is required for the non-static field, method, or property"

How can I modify label2.Text from that other thread?

Advice appreciated.

EDIT:

Ignore, I was going about my task in completely the wrong way.

Question Self-Answered as of 3 Years Ago
Member Avatar
CloneXpert
Junior Poster in Training
64 posts since Aug 2010
Reputation Points: 20 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi, please check this link, it talks about exactly what you need to know :)

http://msdn.microsoft.com/en-us/library/ms171728.aspx

if it doesn't help you, please paste your code snippet and we'll figure out what's wrong.

Hope it helped

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article