开发者

Set the maximum character length of AutoCompleteBox C# WPF

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 AutoCompl开发者_高级运维eteBox.


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜