Hey guys! I've been working on two projects, one needs to have multiple forms, but when I open one form, it needs to close the sender.

But, when I try it, the program exits! I don't want it, I just want to close the form, not the app.

I tried the 'Form1.Hide()' too, but it doesn't sound good to me. There is other approach?

Thanks!

me.dispose(false)

>There is other approach?
In your project's Properties/Application tab, locate the "Shutdown Mode:" and set it for "When last form closes".

I tried both ways, and both had the same result.

Setting the 'Dispose(false)' made the program to continue running after I closed all forms. Same as setting the shutdown mode. When I opened the new form and closed it, the program kept running. What am I doing wrong?

Use Application.Exit() to exit your application whenever needed.

Thank you, now it is working (:

Thank you, now it is working (:

Hi RenanLazarotto, what do you do to when you close form but with-out lost data.

>>Hi RenanLazarotto, what do you do to when you close form but with-out lost data.
Use Me.Hide and Not Me.Close .

Be a part of the DaniWeb community

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