private void tbLog_TextChanged(object sender, TextChangedEventArgs e)
{
//Get only NEW text added to Log
}
/*
LOG
old message...
old message...
old message...
old message...
NEW message...
NEW message...
NEW message...
NEW message...
NEW message...
*/
How to I get only NEW text from the TextBox?
For desktop WPF text boxes, you should be able to use TextChangedEventArgs.Changes to enumerate the changes. Note a single event may contain several changes.
The TextChange class has Offset, AddedLength, and RemovedLength properties that give you the exact range of characters that were changed.
Something like this?
Perhaps you should be using the
TextChangedEventArgs.Changes
property: