When the button is clicked a second form ‘uxDGVdatabase’ is shown and the controls in the calling form are disabled. When the user closes uxDGVdatabase I’d like the controls in uxRevisionHelperForm to be enabled again.
So I’ve assumed that I’ll need to use a delegate to do this? In uxRevisionHelperForm I have the following:
public delegate void myDelegate();
private void updateDataButton_Click(object sender, EventArgs e)
{
myDelegate letsTryThis = new myDelegate(activateGroupBorder);
uxRevisionHelperGroupBox.Enabled = false;
uxDGVdatabase myNewDisplay = new uxDGVdatabase();
myNewDisplay.Show();
}
public void activateGroupBorder() {
uxRevisionHelperGroupBox.Enabled = true;
}
In uxDGVdatabase I have the following – what code needs to go in here?
private void uxDGVdatabase_closed(object sender, FormClosedEventArgs e)
{
}
You put the event handler in the wrong class. You’ll want it like this:
Keep in mind that events are useful to code in another class.