I need to be able to count the textbox characters on a keypress, how would I do that?
GAME -5 Junior Poster
Recommended Answers
Jump to Post— ddanbe 2,724You could use textbox.Text.Lenght. If you have a multiline textbox, use the Lines property wich return an array of strings.
Jump to Post— ereruh 0Not completely sure what you're after but if you want to check if it's between 4 and 20 you could use:
if (txtUser.Text.Length >= 4 && txtUser.Text.Length < 20) { }
All 6 Replies
ddanbe 2,724 Professional Procrastinator Featured Poster
bbman 12 Junior Poster
GAME -5 Junior Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
GAME -5 Junior Poster
ereruh 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.