Joe Carter
Joe Carter

Reputation: 59

Changing datetimepicker background color C#

I have a datetimepicker in my Windows form. This may sound like a silly question with a rather simple answer. However, I just can't find a solution to fit my purpose.

Question > Is there a way in which I can change the back colour of the datetimepicker in the form to a different colour other than the generic white?

Thanks for your help.

Upvotes: 2

Views: 347

Answers (2)

Raful Chizkiyahu
Raful Chizkiyahu

Reputation: 374

Change the BackColor property

Public Class Form1

    Public Sub New()

        InitializeComponent()

        myDateTimePicker1.BackColor = Color.Red

        myDateTimePicker2.BackColor = Color.Yellow

        myDateTimePicker3.BackColor = Color.Green

    End Sub

End Class

or Overrides OnPaint function

msdn with more details

Upvotes: 1

Daniel A. White
Daniel A. White

Reputation: 190925

Set the CalendarMonthBackground property to the color of your choice, but it depends on the theme as well.

Upvotes: 0

Related Questions