CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2000
    Posts
    52

    DTPicker background color

    I would like to change the background color for a DTPicker control. Any hints?
    Thanks
    Dan.h


  2. #2
    Join Date
    Apr 2001
    Location
    Wisconsin, USA
    Posts
    150

    Re: DTPicker background color

    DTPicker has a calendarbackcolor property which you can change, either in code or in the properties window.


  3. #3
    Join Date
    Oct 2000
    Posts
    52

    Re: DTPicker background color

    Well, to be more specific, I want to change the background color in the editbox used to enter the time. I want the controls that are mandatory to have a different background color and I can do them all except this one.
    Thanks for your reply
    dan.h


  4. #4
    Join Date
    Jul 2005
    Posts
    1

    Re: DTPicker background color

    I know this thread is 5 years old, but I have just been asked to make some very quick and dirty changes to a clients VB6 allpication to tide them over for another 12 months while they have the application re-developed into a .NET application.

    Did you every find a solution to be able to set the DTPicker background to another colour as my client is asking a number of these fields to be manditory and the current method to feed this information to the users is for the field to be a different colour.

  5. #5
    Join Date
    Oct 2000
    Posts
    52

    Re: DTPicker background color

    Hi,
    Sorry, never found a soluton!

  6. #6
    Join Date
    Sep 2004
    Posts
    265

    Re: DTPicker background color

    Hi

    Even I faced the same problem, here's what I did (you cannot call it a good solution, but the end user will never know the difference)

    I put a text box without border on the DTPicker control. The user will as usual drop down the dtpicker and select the date. In the CloseUp event of the DTPicker control, I assign the Dtpicker date to the text box like this :

    Private Sub DTPicker1_CloseUp()

    Text.Text = DTPicker1.Value

    End Sub

    You can display the the date in any format in the text box using the format function. You can also set the background colour for the text box. Just make sure you adjust the text box height and width correctly to match that of the DTpicker control and lock the text box.

    This is what I did, and the application is woking fine since 4 years without any end user noticing that there is a text box over a dtpicker control.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured