locked
Use DatePicker with constant width RRS feed

  • Question

  • Hi,

    I am working on a Win 8.1 app and having some trouble with the build in DatePicker control: The width of the control changes when the date changes, e.g. the month dropdown box is small when "April" is selected then when "December" is selected.

    Is it somehow possible to set a fixed width for all components (day, month, year dropdown) of the control?

    Tuesday, January 28, 2014 1:12 PM

Answers

  • Hi Agenor,

    Yes, the width can be fixed if you need.

    Take a look at DatePicker styles and templates, you will find that actually DatePicker is made by three ComboBox(dropdown list), try to set a fixed width for these ComboBox could be the answer for your question.

    Right Click on the DatePicker in VS and select Edit Style->Edit a Copy.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, January 29, 2014 1:34 AM
    Moderator