When FormB closes by clicking on X or other features where it is simply hidden, it is not deleted. If this form is common in this case, delete it when you exit FormA or the application. If this form is not open, you can often use it in a click-event event handler. There you can use the using keyword.
using(FormB b = new FormB()) { if(b.ShowDialog() == DialogResult.OK) {...} else {...} }
Of course, this is possible only when it is shown modal.
source share