Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

The edit field of Date Time Picker can't display date correctly in a .NET Framework 4.7-based application


View products that this article applies to.

Summary

Date field inside the Windows Forms DateTimePicker control might be rendered incorrectly in applications running on Windows 10 Creators Update. Rendering issues might include extra spaces, or missing text, depending on the Format property value.

Format set to Long:

Format set to Long

Format set to Short:

Format set to Short

Format set to Time:

Format set to Time

This issue occurs when the application loads Comctl32.dll Version 5 on Windows 10 Creators Update.

↑ Back to the top


Workaround

Note Applications that use Comctl32.dll Version 6 work correctly.

To work around this issue, use Comctl32 Version 6 by enabling Visual Styles in the app.manifest file as follows:

  <dependency>
    <dependentAssembly>
      <assemblyIdentity 
          type="win32" 
          name="Microsoft.Windows.Common-Controls"
          version="6.0.0.0"
          processorArchitecture="*"
          publicKeyToken="6595b64144ccf1df"
          language="*"
        />
    </dependentAssembly>
  </dependency>
 
 

↑ Back to the top


More information

This issue is caused by a change in native date time picker control in ComCtl32.dll V5, where control’s edit field is not formatted correctly.

For more information, see Enabling Visual Styles and Application.EnableVisualStyles Method ().

For more information about known issues in the .NET Framework 4.7, see Known issues for .NET Framework 4.7.

↑ Back to the top


Keywords: kbbug, kbsurveynew, kbexpertiseadvanced

↑ Back to the top

Article Info
Article ID : 4020817
Revision : 9
Created on : 5/2/2017
Published on : 5/2/2017
Exists online : False
Views : 340