I have two forms, when I click a button on my first form it closes it and opens the 2nd form. However, when I click the default 'X' in the top right corner of the form to close it, it closes but the program's process are still left running in the background. How can I fix this to completely close the program as well?
For default in windows forms in the situation that you cited above - when you close 2-nd form, process of the 1-st form will be also ended. Maybe you use Hide(), not Close(). But if you cant get it you can just write property of Owner, for example form1.Owner = form2; This means that when you close form 2 it will automatic close all like "child" forms for which is owner form2;
And the last - you can use FormClosed event and write all that you want for example Application.Exit(); - for exit from your program and closing all forms and processes.
If you’re a student who is stuck on an assignment or project and you literally have no one to turn to, AssignmentExpert can help you. They managed to get me through my summer semester and for that I am very grateful! 100/100 on my final project! If you think this is a scam, IT IS NOT. Everything is so easy and AssignmentExpert is so helpful! And not to mention they do original work every time! For my final project I got a 10% similarity on TurnItIn!