Question

I'm developing a desktop application in Visual Studio 2008, and I've made the delightful discovery that evidently under Vista, the Calendar control is 45 pixels wider than the same control in XP. Naturally, this ruins the layout of my from, and I don't have space to give. If I tinker with the dimension attributes of the calendar in Vista (using VS2008 running on Vista), as soon as the field loses focus, it snaps back to 227 pixels. Is there a way to resize this bugger or to force it to use the style of calendar that was in XP? It seems really obnoxious to change the fundamental size of a control and break applications that would have otherwise run on both operating systems.

Thanks.

Was it helpful?

Solution

You could Disable Visual styles but this would make your app look really weird. You can do this by removing this line from your Main method:

Application.EnableVisualStyles(); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top