Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically convert WPF TextBox input to All Caps?

Tags:

wpf

textbox

How should I convert all WPF TextBox input text into Caps?

like image 949
patrick Avatar asked Nov 17 '11 17:11

patrick


3 Answers

My guess would be to set the CharacterCasing property on the Textbox.

like image 77
avanek Avatar answered Nov 12 '22 07:11

avanek


I believe TextBox has a CharacterCasing property you can set to Upper

like image 26
novacara Avatar answered Nov 12 '22 09:11

novacara


Add something like that in your global styles in App.xaml

<Style TargetType="{x:Type TextBox}">        
    <Setter Property="VerticalAlignment" Value="Center"></Setter>
    <Setter Property="Height" Value="28"/>
    <Setter Property="Padding" Value="5"/>
    <Setter Property="CharacterCasing" Value="Upper" />
</Style>
like image 1
David Fawzy Avatar answered Nov 12 '22 08:11

David Fawzy