Yes,
I tried the following code per dialog that was not null:
if (form2 != null)
{
form2.DialogResult = DialogResult.Cancel;
form2.Dispose();
form2 = null;
}
the "Argument Exception" comes when I try to set the form1 dialogresult to
ok.
Thanks for the suggestion,
Josh
"Sergey Bogdanov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Have you tried to call form2.Dispose() instead of form2 = null?
>
> Best regards,
> Sergey Bogdanov
> http://www.sergeybogdanov.com
>
>
> Joshua T. Moore wrote:
>> Here is the layout to understand the problem:
>> Application.Run calls LogonDlg.cs
>> LogonDlg (if login successful) opens Form1.cs
>> Form1.cs opens Form2.cs
>>
>> I have an app where a network packet received on a socket logs out the
>> user back to the login screen. This works great if the form1 is the
>> active one, but if I open form2 (showDialog()) and the packet comes in,
>> the form1 sets form2 to null, and gets an "Argument Excpeption" when the
>> form1 tries to set it's DialogResult and return to LogonDlg.
>>
>> Please help.
>>
>> Thanks,
>> Joshua Moore