caret line number (not the "just" line number )
-
Hi! I would like to; "really" know how to get the current text line number where the caret is at. (not the "line number" just the "text line number": when you use textbox1.lines(0) it takes the entire text in line 0 even if some text are in line 1, because the text in line 1(as long as it didn't get there by pressing the return key) belongs to line 0, but when I use the code below it just says the text in line 1(even thought it belongs to line 0) as belonging to line 1.) a = Rtb.GetLineFromCharIndex(rtb.SelectionStart) So can anyone tell me a way to get the real line number of the selected text. thanks in advance
-
Hi! I would like to; "really" know how to get the current text line number where the caret is at. (not the "line number" just the "text line number": when you use textbox1.lines(0) it takes the entire text in line 0 even if some text are in line 1, because the text in line 1(as long as it didn't get there by pressing the return key) belongs to line 0, but when I use the code below it just says the text in line 1(even thought it belongs to line 0) as belonging to line 1.) a = Rtb.GetLineFromCharIndex(rtb.SelectionStart) So can anyone tell me a way to get the real line number of the selected text. thanks in advance
Reposting the same question in the same day won't get it answered any faster. The RTB doesn't support giving you the screen text line of the caret. The screen line of text also doesn't have any meaning. What screen text line is the caret on if the top line of text displayed is only partially visible?? See what I mean? You can get the position of the first character of the line, but there is no method to convert that position to a screen text line. So what are you trying to do with this anyway??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Reposting the same question in the same day won't get it answered any faster. The RTB doesn't support giving you the screen text line of the caret. The screen line of text also doesn't have any meaning. What screen text line is the caret on if the top line of text displayed is only partially visible?? See what I mean? You can get the position of the first character of the line, but there is no method to convert that position to a screen text line. So what are you trying to do with this anyway??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Care to post it?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007