CalendarBackColor, CalendarTitleForeColor Properties Example

The example changes the appearance of the DateTimePicker control's calendar by resetting several color properties. To try the example, place a DateTimePicker and a CommandButton control on a form. Paste the code into the Declarations section of the code module. Start the project and click the DateTimePicker control to see the default colors. Click the CommandButton, and click the DateTimePicker control again to see the new colors.

Private Sub Command1_Click()
   With DTPicker1
      .CalendarBackColor = vbYellow
      .CalendarTitleBackColor = vbRed
      .CalendarTitleForeColor = vbWhite
      .CalendarTrailingForeColor = vbGreen
   End With
End Sub