Howdy just came accross this myself
if you use appendtext this should do the trick, as long as the textbox has
focus,
here is my solution, i used a richtextbox because i wanted to use some of
it's additional reatures, but basically i send the richtextbox a scroll
message,
usage
/// <summary>
/// Adds some status information
/// </summary>
/// <param name="strInfo"></param>
public void AddStatusInfo(string strInfo)
{
tbStatus.AppendText(strInfo);
ScrollTextBoxEnd(tbStatus);
}
#region Native
/// <summary>
/// Scrolls the textbox to the end
/// </summary>
/// <param name="tb"></param>
private void ScrollTextBoxEnd(RichTextBox tb)
{
const int WM_VSCROLL = 277;
const int SB_BOTTOM = 7;
IntPtr ptrWparam = new IntPtr(SB_BOTTOM);
IntPtr ptrLparam = new IntPtr(0);
SendMessage(tb.Handle, WM_VSCROLL, ptrWparam, ptrLparam);
}
[DllImport("User32.dll", CharSet=CharSet.Auto, EntryPoint="SendMessage")]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam,
IntPtr lParam);
#endregion
#endregion //Private