Hello,
My problem: I have DataReceived event for SerialPort, which listens to serial port and appends everything to RichTextBox. Now I'd like to save RichTextBox's content to txt file. I could do this:
string text = RichTextBox.Text;
// save file
RichTextBox.Clear();
But I fear (and please correct me if I am wrong), that just between my two actions (save content to variable, clear RichTextBox) another input could come to SerialPort. Because I didn't saved it to my variable and I clear RichTextBox right after it, this new data could be deleted, without me even knowing that it ever existed.
Could this really happen and how can I avoid it?
Thanks