I have a textbox in WPF, with some c# code behind. I'm also using the serialport library. Generally speaking I can put messages into the textbox when I write or receive from a serial port. I do this by an invoke method. Either by invoking this method:
Or this method....
The above works as expected with no problem.
What I'm trying to accomplish is after displaying some lines of text I want one of my lines of text to stay at a specific line index, because I have a counter, I don't really want the lines to be scrolling after each count. So, for example I've tried using
which retrieves the index # of the last line written, then I just add 1 to it, but I've not found anywhere I can use that index #. The only place I did find something I ended up writing to the character position.
c#:
private void SetTextADCPDisplay(string text)
{
this.TextBoxADCPDisplay.Text = text;
}
C#:
private void AppendTextADCPDisplay(string text)
{
this.TextBoxADCPDisplay.AppendText(text);
}
The above works as expected with no problem.
What I'm trying to accomplish is after displaying some lines of text I want one of my lines of text to stay at a specific line index, because I have a counter, I don't really want the lines to be scrolling after each count. So, for example I've tried using
C#:
var LineIndexNumber = TextBoxADCPDisplay.GetLastVisibleLineIndex(),
which retrieves the index # of the last line written, then I just add 1 to it, but I've not found anywhere I can use that index #. The only place I did find something I ended up writing to the character position.