Custom Date Picker Control

G

Guest

In a VBA userform, is there any way at all to change the background colour
of the portion a date and time picker control (DTPicker) that resembles a
combo box? Although this control appears to be inherited from the generic
MSForms.Control (or a derived class of it), it seems to have somehow
overridden the base class BackColor property with a private property or
something, causing this property to be innaccessible in the DTPicker control
class.


I am developing a form for entering data into Excel and for some of the
fields have dates as values. I really like the built-in date and time picker
control for this, except that I want to be able to change the background
colour of the part of the control that looks like a combo box. And that is
simply not possible with the standard date and time picker. How can I get
around this problem?

I have been trying to create a custom control to emulate the date and time
picker by combining a standard combo box with a hidden month view control
that becomes visible when the user presses the dropdown button of the command
box, but have been having a lot of trouble with this.

Another thing is, even if I select the DTPicker control and click on the
"send to back" button, the DTPicker still shows up on the form on top of any
other controls. The DTPicker is a nice and useful control to use for entering
dates, but it seems to lack some significant functionality that really should
be inherited from the basic control class.
 
T

TJDeborah

Lucas, This might help. Use the FREE color detector from
http://www.cosmin.com It will show you the RGB (red, green, and blue)
components,
HTML hex code, the color name, of the color of the pixel
currently pointed at by the mouse.

Sorry I can't help with actually changing the properties of the picker.
 
G

Guest

Thanks Deborah, but this does not really help me much. I do not actually need
to know what the current colour of the control is, I just want to be able to
set the background of the control to a certain colour.
 
G

Guest

A related problem that I have been having with creating my own custom
controls is that most controls do not seem to have any "GetFocus" or
"LoseFocus" events. Am I simply missing these somehow or do they actually not
exist?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top