It should get disposed as indicated in the C# spec.
http://msdn.microsoft.com/library/de...pspec_8_13.asp
The following code...
using (OpenFileDialog dlg = new OpenFileDialog( ))
{
//do something
}
....should get expanded to something like this...
OpenFileDialog dlg = new OpenFileDialog( );
try
{
//do something
}
finally
{
if (dlg != null)
{
((IDisposable)d lg).Dispose();
}
}
--
Tim Wilson
..Net Compact Framework MVP
"Austin Jan" <au********@gma il.com> wrote in message
news:Op******** ******@TK2MSFTN GP09.phx.gbl...
Hi all,
In this code snip
try
{
using(OpenFileD ialog dlg = new OpenFileDialog( ))
{
//do something
}
}
catch
{
//do someting
}
if CLR throw FileOntFoundExc eption in try block, Will dlg call
dlg.Dispose() finally?
thanks.