Once I red over a little trick, you have to set the SelectionStart propriety
equals the text postion to show and use the ScrollToCarret method to show it
TextBox.SelectionStart=300;
TextBox.SelectionLength=0; //To not show a selectioned area
TextBox.ScrollToCarret();
"Ramsin Savra" <rs****@otxresearch.com> schrieb im Newsbeitrag
news:uS**************@TK2MSFTNGP11.phx.gbl...
Hi, I have below code, to move the cursor to a specific line in a text-box
control (I don't want to use RichTextBox) but doesn't work! any
suggestions?
int charIndex = 1;
for (int i = 0; i < snpObject.edtTextBody.Lines.Length && i <
iRequestedLineNumber - 1; ++i)
{
charIndex += snpObject.edtTextBody.Lines[i].Length;
}
snpObject.edtTextBody.Select(charIndex, 0);