Centering DatePicker control
问题 I am using datepicker control from wpf toolkit. I need to center align the content in datepicker control. How can I achieve this? Tried VerticalContentAlignment="Center". It didn't work. 回答1: <Style TargetType="DatePickerTextBox"> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Padding" Value="2" /> </Style> 回答2: None of the other solutions will work because the vertical alignment of the DatePicker content (text and button) is hard coded in the default WPF style. i.e.