Reputation: 36205
I am currently developing a C# WPF application. I am using the AutoCompleteBox control and I want to limit the user to only enter a limited number of characters, i.e. only be able to enter 10 characters in the autocompletebox.
I know on a normal textbox the property MaxLength would be used but this doesn't seem to be available for the AutoCompleteBox.
Upvotes: 4
Views: 2256
Reputation: 84657
You have the property TextBoxStyle
for the AutoCompleteBox
<toolkit:AutoCompleteBox>
<toolkit:AutoCompleteBox.TextBoxStyle>
<Style TargetType="TextBox">
<Setter Property="MaxLength" Value="10"/>
</Style>
</toolkit:AutoCompleteBox.TextBoxStyle>
</toolkit:AutoCompleteBox>
Upvotes: 11