【问题标题】:Line, column in RichTextBox, WPFRichTextBox 中的行、列、WPF
【发布时间】:2012-06-27 15:14:43
【问题描述】:

我想知道如何使用 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();

如何获得该列?

【问题讨论】:

    标签: c# wpf richtextbox


    【解决方案1】:

    我知道这个问题真的很老,但我自己遇到问题后才解决它。

    c# WPF Line and Column number from RichTextBox

    【讨论】:

      猜你喜欢
      • 2013-08-02
      • 2012-04-05
      • 2013-11-04
      • 1970-01-01
      • 1970-01-01
      • 2010-11-08
      • 2010-12-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多