Sorry for the long delay. I didn't see this post.
There is only one problem left that stumps me. As long as I close out the application completely before I open a file there is no problem. However, it seems to me that I should be able to work with a file, close the file and open it again without closing the entire application. Just like in Microsoft Word, you can open a file or start a new one, edit it, and close the file without leaving MicroSoft Word.
I assume that even though I clear all of the Text Boxes, TreeView Box, List Boxes and so on, so that everything looks like it did before I opened the file, there must be something in the code that is not going back to its previous state. Otherwise, why do I get a different result when I open a file immediately after starting the application than I do when I open a file after saving it and without leaving the application?
How is the file different?
If you write into a file, the text may not actually be written to the disk right away. Instead the system may buffer the data and then write it later when the buffer is full. This is more efficient than writing the data immediately because that would force the program to wait for the relatively slow disk drive.
All this means if the program crashes or exits without flushing or closing the file, some of the data you wanted to write into it may be lost.
So the program should always close the file before exiting.
If you close and reopen the file, it should look the same as if the program had closed and then restarted.
I hope that help. Sorry again for the long delay.