I have some code using forms and ShowDialog that was previously working
perfectly well, but now throws ObjectDisposedExceptions with message
'ObjectDisposedException - cannot access a disposed object called "Icon"'
when ShowDialog is called. Anyone had this kind of error before and any
ideas as to the cause?

======================
Clive Dixon
Digita Ltd. (www.digita.com)

Re: ObjectDisposedException - cannot access a disposed object called "Icon" by Clive

Clive
Fri May 12 10:00:48 CDT 2006

Found the problem - one of the other guys in the team has pulled the rug
from under my feet, and by using Reflector I find that Microsoft have been a
bit naughty and the Icon.Handle property get throws an
ObjectDisposedException if it has a null handle - the object has not been
disposed at all, it hasn't been initialised.

======================
Clive Dixon
Digita Ltd. (www.digita.com)


"Clive Dixon" <clived.noluncheonmeat@digita.noluncheonmeat.com> wrote in
message news:uLVao7cdGHA.3840@TK2MSFTNGP04.phx.gbl...
>I have some code using forms and ShowDialog that was previously working
>perfectly well, but now throws ObjectDisposedExceptions with message
>'ObjectDisposedException - cannot access a disposed object called "Icon"'
>when ShowDialog is called. Anyone had this kind of error before and any
>ideas as to the cause?
>
> ======================
> Clive Dixon
> Digita Ltd. (www.digita.com)
>
>
>