Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change BackColor to DateTimePicker?

Status
Not open for further replies.

penauroth

Programmer
Oct 30, 2001
325
US
How can I change the BackColor of the text in the DateTimePicker after a date has been selected? Thanks.

Paul
 
Paul,

Sorry I can't help you, I have been trying to figure that out for about a week.

If anyone has an idea on how to change the background color of the textbox part of a DateTimePicker I would also like to know

Thanks, Jenn
 
You can set the text color and the background color of almost anything using the API functions SetTextColor and SetBkColor. For the control in question you will have to get the Device Context first...use GetDC to get it...I'm assuming you can get a handle to the datetimepicker to use with GetDC...I would also like to say that the datetimepicker control has some really lame limitations such as the forecolor and backcolor being so hard to change for the actual text area and the fact that it doesn't really accept null values except via that screwy checkbox feature...an as for binding to empty or null dates...forget about it...MS should have their people do a little work on that thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top