mmouer
asked on
IndexOutOfRangeException on form.Dispose or form.Close
The error: "System.IndexOutOfRangeExc eption" occurs when I CLose or Dispose a form I'm developing. As near as I can tell the system returns and executes all of the ComboBox click events after calling the Dispose function.
Why does it do this?
Shouldn't it just Dispose of the form and exit?
Michael
Why does it do this?
Shouldn't it just Dispose of the form and exit?
Michael
ASKER
No I am not creating components dynamically.
The form is made by creating a new Windows Form application and it contains:
1 Label
4 ComboBoxes
3 Buttons
1 DataGridView
1 Binding Navigator
The form is made by creating a new Windows Form application and it contains:
1 Label
4 ComboBoxes
3 Buttons
1 DataGridView
1 Binding Navigator
ASKER
I fixed it by manually disposing of each control that has a click event before I dispose of the form.
I thought this was supposed by the CLI.
Thanks for your help,
Michael
I thought this was supposed by the CLI.
Thanks for your help,
Michael
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and can you show the code you have to create and dispose that form?
I'm sure the problem is somewhere in the way you create/dispose the form