When working on some custom Service Manager forms in Visual Studio, I ran into a somewhat strange UI issue. When you add a DatePicker control and open the form in the console, instead of getting the standard calendar icon, you are presented with this strange "Show Calendar" icon. What makes this even stranger is that in the designer of Visual Studio, the icon shows correctly.
Normal DatePicker in SM Console:
"Show Calendar" DatePicker in SM Console:
"Show Calendar" DatePicker in Visual Studio:
So what's going on here and how do we fix this? The solution is actually quite simple and comes down to which DatePicker control you add to your form.
In Visual Studio, there is a default DatePicker control that comes with the .NET framework. This is found in the WPFToolKit.dll file. If you browse out to the Service Manager install directory, you will also see this same file.
So the solution? Create your DatePicker controls using the WPFToolKit found in the Service Manager folder (highlighted below), not the default one that comes with the .NET framework.
This will ensure your date control renders properly with the correct calendar button image.
I hope this helps those running into this issue!
Until the Whole World Hears,