I have a class named "tables", and a winform "Form1", on the form is a button called "table3". The code in the "tables" class runs in a separate thread and needs access to the button on the main form, this is what I have:
Form1.ActiveForm.BeginInvoke(
(Action)(() =>
{
Form1.ActiveForm.Controls["table3"].Text = "test";
}));
I'm getting a null reference exception.. The name of the button is correct. there's some other problem and I'm not sure what it could be :/