0
我只想在字符串形式顯示的文本從富文本框獲得純文本的顯示部分如何從富文本框
我發現通過
Point pos = new Point(0, 0);
int firstIndex = this.GetCharIndexFromPosition(pos);
int firstLine = this.GetLineFromCharIndex(firstIndex);
//now we get index of last visible char and number of last visible line
pos.X = ClientRectangle.Width;
pos.Y = ClientRectangle.Height;
int lastIndex = this.GetCharIndexFromPosition(pos);
int lastLine = this.GetLineFromCharIndex(lastIndex);
//this is point position of last visible char,
//we'll use its Y value for calculating numberLabel size
pos = this.GetPositionFromCharIndex(lastIndex);
初始行號和最後一個行號怎麼可以獲得過濾rtb文本,並只獲取文本的顯示部分?