Click to See Complete Forum and Search --> : AutoScroll in a RichTextBox
Mongoose
April 19th, 2002, 10:08 AM
Does anyone know how to get a RichTextBox to auto scroll? What I mean is this. When I append text to the RickTextBox I want it to automatically scroll down when the text is not visible. I did this in VB by selecting the last character. However, this does not seem to work with .NET.
Any ideas?
Thanks,
- Jeff
underwar
February 24th, 2003, 05:18 PM
I think this URL might help you:
http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=754&lngWId=10
pareshgh
February 24th, 2003, 05:41 PM
hi,
following method is used for going to direct lineand columns
------------------
private void GoToLineAndColumn(RichTextBox RTB, int Line, int Column)
{
int offset = 0;
for (int i = 0; i < Line - 1 && i < RTB.Lines.Length; i++)
{
offset += RTB.Lines[i].Length + 1;
}
RTB.Focus();
RTB.Select(offset + Column, 0);
}
----------------
Paresh
underwar
February 24th, 2003, 06:27 PM
you recycle ideas.. :D you used the same code for my prob too. lol
pareshgh
February 24th, 2003, 06:36 PM
and this is known as Re-Use
:D
LOL
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.