Click to See Complete Forum and Search --> : DTPicker background color


dan.h
April 18th, 2001, 12:16 PM
I would like to change the background color for a DTPicker control. Any hints?
Thanks
Dan.h

Spectre5000
April 19th, 2001, 01:31 PM
DTPicker has a calendarbackcolor property which you can change, either in code or in the properties window.

dan.h
April 19th, 2001, 02:01 PM
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

jacobsmc
July 18th, 2005, 09:43 AM
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.

dan.h
July 18th, 2005, 10:01 AM
Hi,
Sorry, never found a soluton!

rahulvasanth
July 19th, 2005, 02:26 AM
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.