Click here to Skip to main content
15,070,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am currently on a project where I am adding an app.config to a company's c# projects. Basic process followed to accomplish:
> Copy entire solution and all sub-folders to new directory.
> Change some custom dlls to new references
> Resolve compilation errors
> launch the app
NOTE: No logic or screen layouts were explicitly changed.

When I navigate to a gui in the new app that has a datetimepicker, the calendar looks different. Reference attached pics.

The old one looks like calendar object on this page
The new project's calendars look like the one in this article

What I have tried:

I have tried to change the target framework on the new project to newer/older frameworks.

I have even copy and pasted the source file again into the new project and change basically nothing.

I also tried to copy the guiname.designer.cs & guiname.resx files only (not the guiname.cs file) which means I did not change the design AT ALL. Still same incorrect calendar is displayed.

I dropped and RE-add the System.Windows.Forms reference.

I have also performed SEVERAL google searches with combinations of (DateTimePicker, Display, looks different, etc. with no luck)

Thanks in advance for any assistance!
Posted
Updated 2-Aug-21 22:12pm
Comments
Richard MacCutchan 3-Aug-21 3:41am
   
The 'new' version is actually the older one. You need to check your application is set to use the latest version of .NET.
Richard Deeming 3-Aug-21 4:03am
   
At a guess, either one version is missing an application manifest, or one version is missing the Application.EnableVisualStyles[^] call from the entry-point.
KYTrailer 3-Aug-21 7:03am
   
THANK YOU!!! Richard. That resolved my issue! Very much appreciated!

1 solution

I just checked this and you need to ensure the following statement is in your Main method of Program.cs:
C#
Application.EnableVisualStyles();
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900