-
April 23rd, 2001, 08:33 AM
#1
How to change the Background Color of a Date Time Picker Control?
Hi,
How can I change the Background Color of a Date Time Picker Control?
-
April 23rd, 2001, 08:58 AM
#2
Re: How to change the Background Color of a Date Time Picker Control?
Hi,
Take a look at http://www.codeguru.com/controls/dat..._picker3.shtml . Is this what you are looking for ?
[b]Let me know if that helped.
Visit http://www.geocities.com/contactgirish/homepage.html for some VC++ Links & Notes.If you have time, you can sign the guest book there.
Regards,
V.Girish
-
April 23rd, 2001, 09:05 AM
#3
Re: How to change the Background Color of a Date Time Picker Control?
No,
I don't want to change the background color of the droped down control.
Thanx anyway.
-
April 23rd, 2001, 09:06 AM
#4
Re: How to change the Background Color of a Date Time Picker Control?
override the: (WM_CTLCONTROL)
HBRUSH CDateTimePicker::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
//change the color
}
-
April 24th, 2001, 01:27 AM
#5
Re: How to change the Background Color of a Date Time Picker Control?
Hi,
I think the message you mean is the WM_CTLCOLOR. I could not find any WM_CTLCONTROL message.
Anyway I can't test it right now (I will in 8 hours) but the documentation doesn’t mention anything about DateTimePicker control, are you sure that this will work?
-
April 24th, 2001, 02:33 AM
#6
Re: How to change the Background Color of a Date Time Picker Control?
Yes, you are right, it is WM_CTLCOLOR. I was mistaken, because I was in hurry.
What about my hint, it sholud work because I used this overridable several times within CDialog, it worked. Since DateTimePicker is an object of CDateTimeCtrl class which is derived from CWnd as CDialog, HBRUSH CDlgDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) should work. The only thing you gotta do is to create a new class derived from CDateTimeCtrl and manually override HBRUSH CDlgDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor).
Let me know if it works.
Bayram.
-
April 25th, 2001, 02:30 AM
#7
Re: How to change the Background Color of a Date Time Picker Control?
Unfortunately it does not work. The control does not send any WM_CTLCOLOR message. I've tried MFC or plain Win32 API but the result is the same. I guess there is no way to change the background color this way.
Any ideas?
-
April 25th, 2001, 03:21 AM
#8
Re: How to change the Background Color of a Date Time Picker Control?
I've just saw another post with the same issue and they say that the answer is caching the WM_ERASEBKGND message. I don't know if this is true (I will test it in about 7 hours) but I can't believe it was that simple and I never think of it before.
I will let you know.
-
April 25th, 2001, 09:42 AM
#9
Re: How to change the Background Color of a Date Time Picker Control?
Hi there, how are you going on with the DateTimePicker? Have you got any result?
After some struggle I have had some result. As you know DTP has two windows: first is main which looks like CEdit ctrl and another one is MonthCalendar. I dealt with the first. I want to send you the project (zip), but I do not know your e-mail address.
Reply.
Regard!
Brm.
-
April 26th, 2001, 01:05 AM
#10
Re: How to change the Background Color of a Date Time Picker Control?
No need to send me anything, it works with WM_ERASEBKGND. I can't believe it was that simple and I did't think of it before.
Thanx for your time. Bye!
-
October 16th, 2012, 03:00 AM
#11
Re: How to change the Background Color of a Date Time Picker Control?
Hello
I have read all the thread , my task is similar to change the color of Dropdown of timepicker in MFC.By Erasebackground i got achieved to color the background of the dropdown control, how to change the color of text,
Anybody have any ideas
thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|