Kevin,
If you are ok with changing the position of the caret, then you can set
the SelectionStart property to the length of the text in the control, then,
you would call the ScrollToCaret method on the RichTextBox to scroll to the
end.
If you do not want to change the location of the caret, then you can use
this code:
private const int WM_VSCROLL = 0x115;
private const int SB_BOTTOM = 7;
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam,
IntPtr lParam);
// Scroll to the bottom, but don't move the caret position.
SendMessage(textBox1.Handle, WM_VSCROLL, (IntPtr) SB_BOTTOM, IntPtr.Zero);
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Kevin" <@> wrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi!
Im writing a simple chat, using ReachTextBox as chat viewer, but when the
RTB begins to scroll, the scrollbar not scroll down.
How can i do scroll down automatically?
Thanks!