By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,255 Members | 2,640 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,255 IT Pros & Developers. It's quick & easy.

DateTimePicker BackColor DesignMode

P: 6
I have used the code I found on your site by Herr Wagner. It works perfectly except for one minor problem. The color does not change in design mode, only run mode.

Any suggestions
Jan 4 '08 #1
Share this Question
Share on Google+
5 Replies


daniel aristidou
100+
P: 491
The color does not change in design mode, only run mode.
Which version of vb do you use?....
im not sure about vb6 but in later editions .....you can view the designcode......(This is the code the program uses to display and design your form.)
(not event code)..
I believe the code you placed was in the event area

you need to enter the code in the design area.
Jan 5 '08 #2

P: 6
I'm using VB.Net 2005. I'm not sure what you mean by the "design area" and "event area".
Jan 6 '08 #3

Expert 5K+
P: 8,434
I'm only VB6, but it seems unlikely that anything in your code would affect what the control looks like at design time.
Jan 7 '08 #4

P: 6
.Net allows you to inherit from the Microsoft supplied controls. You can then add properties and methods to enhance the control. Unfortunately, in their infiinte wisdom, Microsoft decided to make the BackColor and ForeColor properties of the DateTimePicker control visible, but did not implement the properties. They also did not provided a user accessible Pain event. Setting the BackColor and ForeColor properties has no effect. If you want to change the BackColor of the DateTimePicker you need to implement your own BackColor property and and override the WndProc subroutine to have the property take effect (see http://dotnet.mvps.org/dotnet/faqs/?...color&lang=en). The code provided at the previously mentioned web site works fine and changes the color run mode but does not change the color in design mode, hence my original question.
Jan 7 '08 #5

Expert 5K+
P: 8,434
Oops! :)
Jan 8 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.