简体   繁体   中英

TextBox Char Length Limit

I searched and didn't find anything that helps my problem. I want my textbox and passwordbox to have a 32 character limit. I tried MaxLength="32" but its gives me this error:

The member "MaxLength" is not recognized or is not accessible.

What parameter should I use?

If you are on WPF, and you are only using XAML as you said than there's no problem using MaxLength, this code makes that TextBox doesn't accept more than 5 chars input:

<Grid>
        <TextBox MaxLength="5"/>
</Grid>

if you still have any problem (that I/we can't imagine if you don't wanna post your code) with this, then just try Clean/Rebuild your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM