G
Guest
Hi all
I've got a little problem regarding the disposing of a form....
My program is like this: I've got a mainForm with a main function, but before loading this form, I need to display an other one (StartSelectionForm) where the user setup his name and other string information
Innocently and full of certainty C# will absorb my simple code, I wrote the following main function
static void Main()
new StartSelectionForm().Show()
Application.Run(new MainForm())
BUT, when I run this.Dispose(); in StartSelectionForm after the user clicked an OK button, I get the following error in the main function
An unhandled exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dl
Additional information: Cannot access a disposed object named "StartSelectionForm"
Does anyone has an Idea why this error comes up
Thank you for your time
Sylvain
I've got a little problem regarding the disposing of a form....
My program is like this: I've got a mainForm with a main function, but before loading this form, I need to display an other one (StartSelectionForm) where the user setup his name and other string information
Innocently and full of certainty C# will absorb my simple code, I wrote the following main function
static void Main()
new StartSelectionForm().Show()
Application.Run(new MainForm())
BUT, when I run this.Dispose(); in StartSelectionForm after the user clicked an OK button, I get the following error in the main function
An unhandled exception of type 'System.ObjectDisposedException' occurred in system.windows.forms.dl
Additional information: Cannot access a disposed object named "StartSelectionForm"
Does anyone has an Idea why this error comes up
Thank you for your time
Sylvain