If I set the value of a string in one form and then display in label on another form by clicking a “update” button on the second form. This part works.
I would like to know how I can make the label update it’s text value after the first form closes.
If I try doing with:
public static void Subject_select()
{
L_Subject.Text = Global.Subject;
}
And then running this with:
msinForm.Subject_select();
Then it throws the error:
An object reference is required for the non-static field,method, or property ‘app1.mainForm.L_Subject’
I suppose better approch is create Global event and fire it when in a first form text was changed and than in second form subscribe to an event and change text in event handler.
Check about global events here. If you will go through static events beware of memory leaks.