Search code examples
wpfinputuppercase

Automatically capitalize all input in WPF


Is there a way to automatically capitalize all input throughout a WPF app?


Solution

  • You can case all input into TextBox controls with the following property:

    CharacterCasing="Upper"
    

    To apply to all TextBox controls in the entire application create a style for all TextBox controls:

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="CharacterCasing" Value="Upper"/>
    </Style>