1

I am running VS Ultimate 2013 (v12.0.31101.00 Update 4) within Windows 7 Ultimate x64 SP1. When I create a Windows Form that contains a System.Windows.Forms.DateTimePicker and run, the calendar has odd vertical lines before every field:

DateTimePicker with odd vertical lines

These lines appear regardless of whether I run in Release or Debug mode, and whether I run from within VS or by double-clicking the exe generated in the bin folder. Does anyone know how to get rid of the vertical lines?

-- EDIT --

Due to suggestions in the comments, I ran some additional tests, the results of which seem to narrow down the possible issue.

First, I copied the resulting executable to my Windows 10 Pro x64 machine. When running the same executable on Win 10, this issue IS NOT present.

Next, I compiled on the Win 10 Pro x64 machine, using VS 2015 Enterprise. When running in Win 10, this issue IS NOT present. However, copying the executable to my Win 7 machine still displays the vertical bars.

The above test makes me think that this is somehow directly related to the OS/.Net version I am using.

Someone suggested that this may be a graphics driver issue. I have Intel integrated graphics, as well as a dedicated NVidia graphics card installed on my machine. First, I ran using each GPU. Regardless of which GPU I use, the result is the same. This makes the possibility of it being a driver issue almost zero. However, I still updated both graphics drivers, just as another data point. Again, this had no effect, and the DateTimePicker is still being displayed with vertical lines on my Windows 7 machine.

So, my question still remains. Has anyone else seen issues with the DateTimePicker, when targeting .Net Framework 4.5 on Windows 7 Pro x64 SP1?

Jeff G
  • 4,470
  • 2
  • 41
  • 76
  • 2
    Just out of curiosity, what font are you using? – Mark Hall Sep 10 '15 at 02:36
  • The default, which is `Microsoft Sans Serif, 8.25pt` on my machine. – Jeff G Sep 10 '15 at 03:08
  • .̩͎̻͖̭̼.̤̯.͈̣̼̣̖ ͓̙͖̗̖za̖͈l͕͈̹̦̰g͔̦̮͈o̥͓?̬ – Blorgbeard Sep 10 '15 at 03:38
  • Looks like a video driver problem to me. Same results on a different PC? – rheitzman Sep 10 '15 at 16:49
  • The only other PC I have available is a Windows 10 Pro x64 machine, running VS 2015 Enterprise. Running on entirely different hardware, a different OS, and a different VS version, the bars don't appear. Unfortunately, that doesn't narrow down the problem enough to troubleshoot. I will ensure my graphics drivers are up to date. – Jeff G Sep 10 '15 at 17:32

1 Answers1

1

Apparently this is an issue with .NET Framework 4.5 running on Windows 7 x64 SP1. When I change the target framework to .NET Framework 4.5.1, this issue is resolved. I can't explain why this is happening, but at least there is a work-around for it.

-- EDIT --

I just discovered that the change to framework version 4.5.1 isn't what resolved the issue. When I made that change, Visual Studio automatically added the following to each property group in the csproj:

<Prefer32Bit>false</Prefer32Bit>

After adding this line to each configuration, this issue was resolved. I'm still looking for an explanation as to WHY this fixes the issue, so I can understand how to avoid it in the future.

Jeff G
  • 4,470
  • 2
  • 41
  • 76