Automatically capitalize all input in WPF

a_hardin picture a_hardin · May 7, 2009 · Viewed 18.7k times · Source

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

Answer

Josh G picture Josh G · May 7, 2009

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>