Emad's Blog

Thoughts/Tips/Shortcuts/Ideas from a .NET software engineer

Archive for December, 2006

Scrolling to end of Text Box Automatically

Posted by emadmagdy on December 27, 2006

In order to automatically scroll to the end of a text box in a windows forms, simply add the following code.

this.txtResults.Text += “\r\n” + newLineData; // newLineData is string added as new line
this.txtResults.Select(this.txtResults.Text.Length, 0);
this.txtResults.ScrollToCaret();

where txtResults is the textbox in question.

Also you need to make sure that the textbox is a multiline AND it has a vertical scroll bar.

That simple code will make the text automatically scroll to the end of the text box.

Posted in Uncategorized | Leave a Comment »

VS 2005 SP1 released

Posted by emadmagdy on December 26, 2006

Visual studio Service Pack 1 has been released.

http://msdn.microsoft.com/vstudio/support/vs2005sp1/default.aspx

You can find service pack for visual studio professional, Express and Team suite Editions.

Posted in Uncategorized | Leave a Comment »