How to customize the appearance of the WinForms DateTimePicker?
Customize the appearance of DateTimePickerAdv
You can customize the appearance of the DateTimePickerAdv in multiple aspects. The following code example demonstrate the same.
C#
//Sets the backcolor of the DateTimePickerAdv. this.dateTimePickerAdv1.BackColor = colorPickerButton1.SelectedColor; //Sets the border color of the DateTimePickerAdv. this.dateTimePickerAdv1.BorderColor = colorPickerButton2.SelectedColor; // Sets the fore color of the DateTimePickerAdv. this.dateTimePickerAdv1.ForeColor = colorPickerButton3.SelectedColor; // Sets the days’ color of the Month calendar popup. this.dateTimePickerAdv1.Calendar.DaysColor = colorPickerButton4.SelectedColor; // Sets the day names’ color of the Month calendar popup. this.dateTimePickerAdv1.Calendar.DayNamesColor = colorPickerButton5.SelectedColor; // Sets the Inactive month color of the Month calendar popup. this.dateTimePickerAdv1.Calendar.InactiveMonthColor = colorPickerButton6.SelectedColor; // Sets the title back color of the Month calendar popup. this.dateTimePickerAdv1.CalendarTitleBackColor = colorPickerButton7.SelectedColor; // Sets the title fore color of the Month calendar popup. this.dateTimePickerAdv1.CalendarTitleForeColor = colorPickerButton8.SelectedColor; // Sets the fore color of the Month calendar popup. this.dateTimePickerAdv1.Calendar.ForeColor = colorPickerButton12.SelectedColor; // Sets the grid color of the Month calendar popup. this.dateTimePickerAdv1.Calendar.GridBackColor = colorPickerButton11.SelectedColor;
VB
'Sets the backcolor of the DateTimePickerAdv. Me.dateTimePickerAdv1.BackColor = colorPickerButton1.SelectedColor 'Sets the border color of the DateTimePickerAdv. Me.dateTimePickerAdv1.BorderColor = colorPickerButton2.SelectedColor 'Sets the fore color of the DateTimePickerAdv. Me.dateTimePickerAdv1.ForeColor = colorPickerButton3.SelectedColor 'Sets the days color of the Month calendar popup. Me.dateTimePickerAdv1.Calendar.DaysColor = colorPickerButton4.SelectedColor 'Sets the day names color of the Month calendar popup. Me.dateTimePickerAdv1.Calendar.DayNamesColor = colorPickerButton5.SelectedColor 'Sets the Inactive month color of the Month calendar popup. Me.dateTimePickerAdv1.Calendar.InactiveMonthColor = colorPickerButton6.SelectedColor 'Sets the title back color of the Month calendar popup. Me.dateTimePickerAdv1.CalendarTitleBackColor = colorPickerButton7.SelectedColor 'Sets the title fore color of the Month calendar popup. Me.dateTimePickerAdv1.CalendarTitleForeColor = colorPickerButton8.SelectedColor 'Sets the fore color of the Month calendar popup. Me.dateTimePickerAdv1.Calendar.ForeColor = colorPickerButton12.SelectedColor 'Sets the grid color of the Month calendar popup. Me.dateTimePickerAdv1.Calendar.GridBackColor = colorPickerButton11.SelectedColor
Figure 1: DateTimePickerAdv appearance
Samples:
Conclusion
I hope you enjoyed learning about how to customize the appearance of the WinForms DateTimePicker.
You can refer to our WinForms DateTimePicker feature tour
page to know about its other groundbreaking feature
representations and documentation, and how to quickly get started for configuration
specifications. You can also explore our WinForms DateTimePicker example to understand how to create and manipulate data.
For current customers, you can check out
our components from the License and Downloads page. If you are new to Syncfusion, you can try our
30-day free trial
to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!