Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 64767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:50:29+00:00 2026-05-10T18:50:29+00:00

In .NET (at least in the 2008 version, and maybe in 2005 as well),

  • 0

In .NET (at least in the 2008 version, and maybe in 2005 as well), changing the BackColor property of a DateTimePicker has absolutely no affect on the appearance. How do I change the background color of the text area, not of the drop-down calendar?

Edit: I was talking about Windows forms, not ASP.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:50:30+00:00Added an answer on May 10, 2026 at 6:50 pm

    According to MSDN :

    Setting the BackColor has no effect on the appearance of the DateTimePicker.

    You need to write a custom control that extends DateTimePicker. Override the BackColor property and the WndProc method.

    Whenever you change the BackColor, don’t forget to call the myDTPicker.Invalidate() method. This will force the control to redrawn using the new color specified.

    const int WM_ERASEBKGND = 0x14; protected override void WndProc(ref System.Windows.Forms.Message m) {     if(m.Msg == WM_ERASEBKGND)     {         using(var g = Graphics.FromHdc(m.WParam))         {             using(var b = new SolidBrush(_backColor))             {                 g.FillRectangle(b, ClientRectangle);             }         }         return;     }      base.WndProc(ref m); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET website that has been deployed since 2008 with plenty of
As a professional .net developer (at least this is how I earn my money)
In Asp.Net MVC 2.0, at least in the beta, you could decoration your model
There's at least two Bcrypt implementations in C out there: The original: http://bcrypt.sourceforge.net/ Openwall's:
I'm an experienced developer who has been working with .Net for the last 5
I have the following situation: .net 3.5 WinForm client app accessing SQL Server 2008
I am using .NET 4.0 & C# and SQL Server 2008. I have a
Context: ASP.NET MVC 2.0, Linq-to-Sql, .Net 3.5, IIS7, MS SQL 2008 I'm working on
Trying to do basic SSL-authenticated Web Service using Visual Studio 2008 .NET 3.5 Service
Until last week, I developed with SQL Server 2008 non-R2 and my ASP.NET MVC

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.