ccravenbartle
asked on
VB.Net datetimepicker control - how to change the textbox forecolor
This should be easy but I can't figure it out. With VB.Net how do you change the forecolor of the datetimepicker textbox?
I can see various properties that can be used to change the colors of the calendar but I can't see a property for changing the forecolor of the date that is displayed in the text box once the user has picked the date.
I can see various properties that can be used to change the colors of the calendar but I can't see a property for changing the forecolor of the date that is displayed in the text box once the user has picked the date.
ASKER
Rats. This is a bit of a blow. My program compares the date selected with another date and, if it is earlier than the other date, the date is accepted but displayed in red to warn the user that there may be a problem. Any ideas on how I could do this if there is no forecolor text property available with the datetimepicker?
Have you thought of using the ErrorProvider?
ErrorProvider1.SetError(Da teTimePick er1, "Warning Message!")
It will show an icon next to the date time picker, and provide the warning message as a tooltip.
At the very least, you could hide/unhide a label above the control.
ErrorProvider1.SetError(Da
It will show an icon next to the date time picker, and provide the warning message as a tooltip.
At the very least, you could hide/unhide a label above the control.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Eric,
What did that article say about ForeColor?
Bob
What did that article say about ForeColor?
Bob
It shows how to override the OnPaint method of the DateTimePicker to draw the string the way (and the color) you want.
Cool b-) Thanks :D
Bob
Bob
Bob