I have a question about using Delegates in a Windows Form.
I have a DialogForm that can be called several times from the same place (it's basically a form for the user to specify search criteria). It's called like this from a button Click event:
if (this.oFinder == null)
this.oFinder = new FinderForm();
if (this.oFinder.ShowDialog() == DialogResult.OK)
{
}
Because this.oFinder is never released, the DialogForm still exists. This is by design. When the user clicks on the button again to bring up the Finder Form another time, his previous search criteria is still shown, so that he is able to change only what needs changing in order to search again (without having to fill in all the data again). OK, this works great, but there's one glitch:
The form has a few ComboBoxes with Delegates for the SelectedIndexChanged events. The first time the form is loaded, this works fine. But after that, the SelectedIndexChanged events fire way too many times and give unexpected results. It seems that the easiest way to fix this would be to be able to basically disable the Delegates until I'm ready to assign them again, instead of having them already assigned every time the form shows.
I hope I've explained this clearly enough. Does anybody have any clue as to whether you can disable or turn off a Delegate once it's been assigned?
TIA,
~~Bonnie