This is my first post. I am a novice in VB.NET. I am able to hide form1 from from2. But I am not able to close the form1 or exit the application from form2. Is there any way in which I can exit the application except from the startup form i.e., form1. Thanks in advance.

Recommended Answers

Did you try using Application.Exit(). Call this function when you want the entire application to end.

For more help, www.NeedProgrammingHelp.com

Jump to Post

All 4 Replies

Did you try using Application.Exit(). Call this function when you want the entire application to end.

For more help, www.NeedProgrammingHelp.com

nice piece of code. iam amazed that my faculty did not know this. i found the link useful. thank you NHP.

Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Form1.Close()

End Sub


try this.

alyngill is right , use above mentioned code , it will solve your prob .
Regards

Be a part of the DaniWeb community

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