如图所示
VB.NET中怎样获取光标在RichBoxText文本框中的位置?
事件、代码都是是什么?
Private Sub RichTextBox1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.SelectionChanged
Dim pos = RichTextBox1.GetPositionFromCharIndex(RichTextBox1.SelectionStart)
Dim x = RichTextBox1.GetCharIndexFromPosition(pos).ToString
Dim y = RichTextBox1.GetLineFromCharIndex(RichTextBox1.SelectionStart).ToString
Label1.Text = "行:" + y + " 列:" + x
End Sub