I have created an app in VB.Net. A child form is displayed using the Showdialog() method so that the parent cannot be accessed until the child is closed.
I need the child form to be disposed every time it is closed so that the information it contains is removed: For this I have put, “Me.Dispose()” in the closing event of the child form.
However, often (not always) when the child is closed the parent is minimized, which is not what I want.
Does anyone know of any way to stop that from happening? All help is appreciated.
A better way to do it is to wrap your modal window in a using statement rather than using Me.Dispose in the closing event of the form. For example, in your parent form do this: