tags:

views:

529

answers:

1

In VB6, I have a DTPicker control on a form. (The DTPicker is the calendar date/time selector, included in Microsoft Windows Common Controls-2 6.0, available from the Components dialog.)

While there are many properties to affect the colors of the calendar when it's dropped down, there is no property that allows changing the color of the date that's displayed in the textbox. I'm looking for something like the standard TextBox's ForeColor property.

Does anyone have a little API magic to allow me to simulate that property?

+1  A: 

I hate to post something that is not really helpful, but this appears to be something beyond the scope of what Microsoft intended developers to do with the control. While there must certainly be an API call to set the color (Windows certainly knows to paint it black when enabled and gray when disabled), the method to do so escapes me.

My recommendation, should no one else respond with how to do what you need, is to either obtain a new DateTime Picker control with the needed properties (it would seem that there are a few 3rd party options), or "roll your own" control.

FWIW, this same issue exists in VB.NET with the exception being that Microsoft specifically overrides (and then hides) the ForeColor (and BackColor) properties inherited from the generic Control object to do nothing.

smbarbour
I'm going to accept this answer since it's the only one I've received in over a year, and it matches up well with what I ended up doing, which was to just give up. Strange that Microsoft didn't expose a property for this, but ... whatever.
JeffK