Using the using statement with WinForms... Good Practice?

Posted by Nate Heinrich on Stack Overflow See other posts from Stack Overflow or by Nate Heinrich
Published on 2010-03-08T23:04:47Z Indexed on 2010/03/08 23:06 UTC
Read the original article Hit count: 274

Filed under:
|
|
|

I understand the concept and reasons behind using the using statement, and I use it with things like file resources and remote connections, I was wondering if it is good practice to use the using statement with WinForm forms and dialogs?

using (MyDialog dlg = new MyDialog())
{
    if (dlg.ShowDialog() == EDialogResult.OK)
    {
        // Do Something
    }
}

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms