Try doing TreeView1.Nodes.Clear before you unload the form. If that doesn't work please post the code you use to end the program.