does any one experience this while using mdi

the code is something like this

using a as new form
    a.mdiparent = this
    a.showdialog()
end using

then when i tried to show the new form it will close automatically.

why is that happening?

thank you

Because a Using block automatically disposes of any resources used in it. So if you stil want to use your form, don't put it in a using block. See MSDN for more details.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.