You need to know how many characters can be filled on your textbox per line, then you can count the number of characters and on the Keypress event of the Textbox and then assign it to the String if it reaches your maximum count or if you pressed the enter key.

Of course you need to handle the pressing of backspace, delete, etc.