Question Delegates - An Object Reference is required for the non-static field, method or prope

Neil

New member
Joined
May 13, 2014
Messages
1
Programming Experience
Beginner
Hi, I'm learning C# and trying to use a delegate to update a status label from a background worker. That's how I did it in VB. I keep getting an object reference error though with the code toolStripStatusLabelMessage.Text = message;. Here's my code:

public delegate void UpdatetoolStripStatusLabelMessageDelegate(string message);
public static void UpdatetoolStripStatusLabelMessage(string message)
{
toolStripStatusLabelMessage.Text = message;
}
 
Last edited:
Please show us the code that creates and invokes the delegate. Also, what is the rest of the error message? Does it specify that "Text" is the name of the non-static member in question?
 
Back
Top Bottom