Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting the number of lines for a multiline textbox

Status
Not open for further replies.
Mar 9, 2006
93
CA
Does anyone know how to limit the number of lines and/or the number of characters per line in a multiline textbox. Any help would be greatly appreciated.
Thanks
Matt
 
put some code in the KeyUp or perhaps textChanged event.

Check the overall length of the text using txtMyTextBox.Text.Length

For # of lines, you'd probably have to count the number of line feeds in the text property.

Though you could just set the MaxLength property to whatever you want your limit to be. Would probably be easier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top