tags:

views:

279

answers:

2

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.

Thanks

A: 

Create ControlTemplate for DatePicker and set "VerticalContentAlignment" property of PART_TextBox element to "Center".

andy369
A: 

Include this piece of code in the Resources of parent control:

<Style TargetType="{x:Type DatePickerTextBox}">
    <Setter Property="VerticalContentAlignment" Value="Center" />
</Style>