Re: DateTimePicker Background Color in Vista



Thanks, I was hoping there was a workaround to make it work in both XP and Vista but I may just have to start playing with the messages in WndProc and see what I can get to work.

Nicolas Cadilhac/VisualHint - thank you for the suggestion, I will certainly take a look at it.

Thanks,

Bob Dankert

"Linda Liu[MSFT]" <v-lliu@xxxxxxxxxxxxxxxxxxxx> wrote in message news:8ZDNDuIEIHA.5712@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Bob,

I performed some tests on this issue and did reproduce the problem. The
BackColor property of the DateTimePicker control doesn't work on either
Windows XP or Vista. The workaround provided in the link you mentioned
fixes this problem on Windows XP but not on Vista.

I looked up this issue in our internal database and found that this is a
known bug about the DateTimePicker control. The Windows Forms
DateTimePicker is a wrapper on a DateTimePicker provided by the Windows OS
(that ships with Windows) and the underlying control does not support
directly changing the edit box fore color and back color.

About the workaround to solve this bug, it's the Vista theme that makes the
workaround which works on Windows XP fail. If you disable the visual styles
for the application, you should see that the above workaround works on
Windows Vista.

So a solution to solve this bug on Vista is to disable the visual styles
for the application and apply the above workaround.

If you're using C#, you could comment out the line of code
'Application.EnableVisualStyles();' in the static Main method to disable
the visual styles for the application.

If you're using VB.NET, you could clear the checkbox before the 'Enable XP
visual styles' option in the Application tab within the project designer.

Hope this helps.
If you have any concern, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


.



Relevant Pages

  • Re: VB6 Runtimes in Windows 7 ?
    ... Here is MS page for Windows 7: ... Wikipedia pages: ... but I see that it's removed from Vista. ... a workaround for Vista, but it's not supported in future versions. ...
    (microsoft.public.vb.general.discussion)
  • Re: XP and Vista in dualboot
    ... Now, i now that's better to install XP, and then Vista. ... There's a workaround where the Vista drive is basically hidden from the XP ... No restore points are available when you use Windows Vista or Windows Server ...
    (microsoft.public.windowsxp.general)
  • Re: Update KB950125 Vista 64 Fails...
    ... Did you open a free Vista SP1 support incident, ... there will be free & unlimited Vista SP1 support via email and/or chat. ... Windows Internet Explorer, ...
    (microsoft.public.windowsupdate)
  • Re: A correct "mojave" experiment for Vista
    ... Just because I continuislly bash vista doesn't make me a troll. ... Here is a summary of the new version of windows ... so that you can install features as add ons. ... credential providers instead of GINA, improved IPSEC support, better wireless encryption support, ... ...
    (microsoft.public.windows.vista.general)
  • Re: WMP11 "Support" is not good
    ... I have a clean, from scratch, installation of Vista Ultimate 32-bit. ... The "support" provided by Microsoft, for WMP11, is: ... Windows Media Player 11 ... For help with Windows Media Player 11, you can use the support options ...
    (microsoft.public.windowsmedia.player)