M
Matthew Wells
Hello all,
This is not about reading a text file. I have a C# Windows Form with a
datagridview on the left side listing some text files. On the right side, I
have embedded notepad in a panel that displays the selected file. I am
using notepad instead of a richtextbox because the users need the
functionality.
When a user clicks a different file, the new file appears. No problem. But
if a user makes changes to a file and does not manually do File->Save before
clicking a new item in the grid, the changes are lost.
I would like to be able to read the contents of the notepad in the form both
when the file is loaded and BEFORE loading the next file so I can do a
comparison and prompt the user to save. I don't want to change the file's
modified date unless an actual change is made. Also, there's a lot of other
things that happen if a file changes so just saving everything is not an
option.
Thank you.
Matthew Wells
(e-mail address removed)
This is not about reading a text file. I have a C# Windows Form with a
datagridview on the left side listing some text files. On the right side, I
have embedded notepad in a panel that displays the selected file. I am
using notepad instead of a richtextbox because the users need the
functionality.
When a user clicks a different file, the new file appears. No problem. But
if a user makes changes to a file and does not manually do File->Save before
clicking a new item in the grid, the changes are lost.
I would like to be able to read the contents of the notepad in the form both
when the file is loaded and BEFORE loading the next file so I can do a
comparison and prompt the user to save. I don't want to change the file's
modified date unless an actual change is made. Also, there's a lot of other
things that happen if a file changes so just saving everything is not an
option.
Thank you.
Matthew Wells
(e-mail address removed)