Ribbon for WinForms | ComponentOne
Elements / Ribbon Items / Date Picker
In This Topic
    Date Picker
    In This Topic

    A date picker allows a user to choose a specific date from a drop-down calendar or enter a specific date in the numeric box. The user can click the DatePicker's calendar icon to select a date.

    Date picker

    Adding DatePicker in Designer

    The Ribbon DatePicker can be added at design-time using the Ribbon Group Floating Toolbar or RibbonGroup Items Collection Editor. Also, you can customize the look of the Ribbon DatePicker by using the Ribbon DatePicker Floating ToolBar or editing the properties in the Properties window. Refer this topic for more information on floating toolbars.

    This image below shows the floating toolbar of DatePicker.

    Floating toolbar

    Adding DatePicker through Code

    The date picker item can also be added to the C1Ribbon control through the code using the RibbonDatePicker class. This is depicted in the code below:

    ' Add DatePicker ribbon item
    Dim datePicker As RibbonDatePicker = New RibbonDatePicker()
    datePicker.Format = "yyyy/MM/dd"
    formatGroup.Items.Add(datePicker)
    
    // Add DatePicker ribbon item
    RibbonDatePicker datePicker = new RibbonDatePicker();
    datePicker.Format = "yyyy/MM/dd";
    formatGroup.Items.Add(datePicker);