I have 2 TextBox
es in my wpf app, one for user name and other for password, both have FontSize=20
, but the text appears like this:
How can I fix this?
Xaml:
<TextBox Grid.Row="1" Grid.Column="1" Height="40" BorderThickness="1" BorderBrush="#FFD5D5D5" FontSize="36" Text="test" />
<PasswordBox Grid.Row="3" Grid.Column="1" Height="40" BorderThickness="1" BorderBrush="#FFD5D5D5" FontSize="36" Password="test" />
To Center the text in a TextBox use the VerticalContentAlignment Property of the TextBox.
<TextBox Text="The text" Height="40" VerticalContentAlignment="Center" />