Bunifu Date Picker
Create great user experience with good looking date pickers
Last updated
Create great user experience with good looking date pickers
Last updated
Bunifu Date Picker is a rich .NET control that allows you to quickly select a date from a pop-up calendar. It supports various different custom and pre-defined date formats. Date selection can be restricted by specifying minimum and maximum dates.
This section briefly describes how to add BunifuDatePicker
with its basic functionalities.
Locate BunifuDatePicker
in your toolbox and drag it to your form as shown below and then customize it to your desired look and feel using properties that will be elaborated on later in this article.
To add BunifuDatePicker
at run-time, access your Form's Load event and add the following code snippet:
This section explains on customizing the look and feel of BunifuDatePicker
by using the properties that are elaborated below:
Font
This property gets or sets the font styles which will be applied on the selected date displayed on the calendar's textbox. The property is directly accessible in the design view from BunifuDatePicker's
smart tag or via the property pane.
Don't use CalendarFont
property to set the date picker's font. Ensure to look out for the Font
property
ForeColor
This property gets or sets a color of the date text displayed on the calendar's textbox. It supports both the RGB and HEX color formats.
Color
This property gets or sets the border color of the calendar's textbox. It supports both the RGB and HEX color formats.
LeftTextMargin
This property gets or sets an integer value that specifies the margin area on the left side of the displayed date in the calendar textbox. The greater the value, the more the left margin area is created.
DisabledColor
This property gets or sets a color value that gets applied at runtime when BunifuDatePicker
has been disabled. It supports both the RGB and HEX color formats.
DateBorderThickness
This property gets or sets an enumerated value that determines the width of a date picker's border.
There are two distinct values enumerated: thick
and thin
. The thick value sets the sets a dense border to the date picker's textbox while the thin value sets a narrow border to the date picker's textbox.
Icon
This property gets or sets an image resource that is rendered on the default right side of the date picker's textbox. We recommend that you use .ico
image resources as a preferred icon type for BunifuDatePicker
.
Using .ico
image resources give you an upper hand to modify its color with theBunifuDatePicker's
IconColor
property. You can get these .ico types of icons by downloading the Pichon app here.
IconColor
This property gets or sets a color value for the date picker's icon. You can set an RGB or a HEX color value format.
This property works only with .ico types of icons. Other formats such as jpeg and png are incompatible with this property.
IconLocation
This property gets or sets the icon's position using one of the enumerated left or right values. By default, the icon is positioned to the right side of the date displayed inside the date picker's textbox.
DisplayWeekNumbers
This property gets or sets a boolean value that, when set to true, displays week numbers in the first column alongside the dates displayed on the popup calendar.
BorderRadius
This property gets or sets an integer value that specifies the roundness of the date picker's edges.
BunifuDatePicker
BunifuDatePicker
allows you to either enter a date or select it from the popup calendar. To get the date selected by a user, use the ValueChanged
event to observe the date selection changes, and use the value property to get the date selected by the user.
Here's the code that implements the above statement:
A date range can be specified by using the MinDate
and MaxDate
properties of BunifuDatePicker
to prevent the user from selecting dates that are out of scope or irrelevant.
The format property allows you to get or set the date and time display pattern for the value displayed inBunifuDatePicker's
textbox and also in its set value property.
BunifuDatePicker supports the following DateTime formats
The long date format is a standard date pattern that displays the name of a month, the date value, and the year as specified on your operating system (i.e the windows regional settings
). Here's an example of a long date format:
The short date format displays the date pattern as dd/mm/yy
but uses the date separator specified in your operating system. For example, in English (U.S.), the specified separator is the slash (/). Here's an example of a short date format:
The custom format allows us to define our own date pattern. Custom formats that are inconsistent with the date/time settings specified in Windows regional settings are ignored.
To create a custom format, use the following characters as placeholders and separators.
Character
Description
c
Displays the general date format.
d or dd
Displays the day of the month as one or two digits. For one digit, use a single placeholder; for two digits, use two placeholders.
ddd
Displays an abbreviated the day of the week to three letters.
dddd
Displays the full name of the day of the week
ddddd
Displays the short date format
dddddd
Displays the long date format
m or mm
Displays the month as either a one-digit or two-digit number.
mmm
Displays an abbreviated name of the month to three letters. For example, August appears as Aug.
mmmm
Displays a full named month.
yy
Displays the last two digits of the year.
yyyy
Displays all digits in a year for 0001-9999 depending on the date and time data type supported range.
You have just learned how to use Bunifu Date Picker. Built-in customization is well developed. There are many methods, options, and events you can use for making the tools you need. Its look and feel is quite simple and straightforward. It fits perfectly to be chosen for any corporate applications. Got Questions? We would love to answer and support you. Feel free to chat with us on our support page.
The
CalendarForeColor
property doesn't set the date picker's text color. Ensure to look out for the ForeColor
property