Re: DateTimePicker Background Color in Vista
- From: "Bob Dankert" <bobatnvsn-itdotcom@xxxxxxxxxxxxx>
- Date: Wed, 17 Oct 2007 07:56:37 -0500
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.
.
- Follow-Ups:
- Re: DateTimePicker Background Color in Vista
- From: Linda Liu[MSFT]
- Re: DateTimePicker Background Color in Vista
- References:
- DateTimePicker Background Color in Vista
- From: Bob Dankert
- RE: DateTimePicker Background Color in Vista
- From: Linda Liu[MSFT]
- DateTimePicker Background Color in Vista
- Prev by Date: Re: DateTimePicker Background Color in Vista
- Next by Date: Auto generated context menu for TextBox
- Previous by thread: RE: DateTimePicker Background Color in Vista
- Next by thread: Re: DateTimePicker Background Color in Vista
- Index(es):
Relevant Pages
|