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:
Top Bottom