You should definetly read the manual offered by Microsoft:
String manipulation[
^]
MessageBox[
^]
The way that you asked the question I cant really tell if you are talking about a normal TextBox or a RichTextBox:
TextBox[
^]
RichTextBox[
^]
You also neglected to inform us on whether or not this was WinForm, WPF or any other UI...
Read the links, and when you have come back and update your question if you are still facing some issues. Good luck:)