Home
Manage Your Code
Snippet: Current Row and column in Richtextbox (VB.NET)
Title: Current Row and column in Richtextbox Language: VB.NET
Description: Find the current row and column Views: 85
Author: Patrick Beyltjens Date Added: 7/3/2008
Copy Code  
1 Private Sub show_status()
2
3      Dim pt As Point
4      Dim index As Integer = 0
5      Dim row As Long
6      Dim col As Long
7      index = rtbBox.GetFirstCharIndexOfCurrentLine()
8      row = rtbBox.GetLineFromCharIndex(index)
9      index = rtbBox.SelectionStart
10      pt = rtbBox.GetPositionFromCharIndex(index)
11      pt.X = 0
12      c = index - rtbBox.GetCharIndexFromPosition(pt)
13      rowcolStatusLabel.Text = Convert.ToString("Row : " & (lijn + 1) & " Col : " & (kol + 1))
14
15   End Sub
Usage