Adding Icons to the DateTime Picker

Windows Phone Tutorial

If you just add a DateTime Picker (from the Windows Phone Toolkit) to your application,DateTimePicker it will work but its icons will be very unsatisfactory – just a pair of X’s.  To get the proper icons, follow these steps:

1. Add the DateTime Picker to your application
2. Copy the Toolkit.Content folder from the Toolkit Samples to your application
3. Create a Toolkit.Content folder in your application and Add-Existing to add the contents to your application
4. Set all of the .png files from Resource to Content
5. Rebuild and run.  Hey Presto! The correct icons appear.

(30)

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen online courses. His latest book, Building APIs with .NET will be released early in 2025. Liberty is a Senior SW Engineer for CNH and he was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Microsoft MVP.
This entry was posted in Essentials, Mango, Mini-Tutorial, UI and tagged . Bookmark the permalink.

5 Responses to Adding Icons to the DateTime Picker

  1. Jessica says:

    How do you do Step 4?

    I can’t seem to figure out how to change .png files from resource to content.

    Thanks!

    • mekodani says:

      Hi Jessica ,select .png files then open property there you will find build action there you can change it to content or resources.

  2. Great tip. I was looking for solution about a day… Now my date time pickers works great. Thanks again…

  3. Pedro Lamas says:

    Great info, just a small addend: if you add the Toolkit via NuGet, the “Toolkit.Content” folder gets automatically added to the project, but you still have to set the files to “Content” and “Copy Always” 😉

    • Timo says:

      Hi Pedro. Thanks for your advice. “Content” is enought. There is no need to “Copy” it anywhere. “Do not copy” works.

Comments are closed.