[英]Line, column in RichTextBox, WPF
我想知道如何使用WPF中的RichTextBox自動用行號和列號更新狀態欄。
首先,我要掛接到哪個事件? 我的盒子是多行的。 KeyDown不會對插入符號的上下移動做出反應。
行號可以是使用以下內容的計算機:
int someBigNumber = int.MaxValue;
int lineMoved, currentLineNumber;
editor.CaretPosition.GetLineStartPosition(-someBigNumber, out lineMoved);
currentLineNumber = -lineMoved + 1;
status_bar.Text = "Line " + currentLineNumber.ToString();
如何獲得專欄?
我知道這個問題確實很老,但是我自己解決問題后才解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.