+ Reply to Thread
Results 1 to 4 of 4

Custom Date Picker Control

  1. #1
    Lucas Swanson
    Guest

    Custom Date Picker Control

    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.

  2. #2
    Registered User
    Join Date
    04-05-2006
    Posts
    6
    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.

  3. #3
    Lucas Swanson
    Guest

    Re: Custom Date Picker Control

    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.

    "TJDeborah" wrote:

    >
    > 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.
    >
    >
    > --
    > TJDeborah
    > ------------------------------------------------------------------------
    > TJDeborah's Profile: http://www.excelforum.com/member.php...o&userid=33186
    > View this thread: http://www.excelforum.com/showthread...hreadid=534782
    >
    >


  4. #4
    Lucas Swanson
    Guest

    RE: Custom Date Picker Control

    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?

    "Lucas Swanson" wrote:

    > 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.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1