Hi I'm opening a form like this from my main form when the user makes a selection of a menu item.
private void commToolStripMenuItem_Click(object sender, EventArgs e)
{
Command_Form Command_Form1 = new Command_Form();
Command_Form1.ShowDialog();
// Command_Form1.Dispose(); this didn't help
}
Inside the form "Command_Form1" I close it like this when the user clicks on the close button
private void Close_button_Click(object sender, EventArgs e)
{
this.Close(); //I get the exception here
}
This process works fine once but on the second closing of the form (Which I hope is a completely different/new instance of the form) I get the error in the title of this post. This is the output in the debug window.
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll 9there are three copies in the debug window if that means anything)
When I step into the Close() method that is where the error is thrown but I'm having difficulty understanding what is going on. Is there something that I can read to help me understand what is going on inside the close method?