GrapeCity MultiRow Windows Forms Documentation
ShowUpDown Property
Example 


Gets or sets a value that indicates whether a spin button control (also known as an up-down control) is used to adjust the date and time value.
Syntax
<SRDescriptionAttribute("Indicates whether a spin box rather than a drop-down calendar is displayed for modifying the cell value.")>
<SRCategoryAttribute("Appearance")>
<DefaultValueAttribute()>
Public Property ShowUpDown As Boolean
Dim instance As DateTimePickerCell
Dim value As Boolean
 
instance.ShowUpDown = value
 
value = instance.ShowUpDown
[SRDescription("Indicates whether a spin box rather than a drop-down calendar is displayed for modifying the cell value.")]
[SRCategory("Appearance")]
[DefaultValue()]
public bool ShowUpDown {get; set;}

Property Value

true if a spin button control is used to adjust the date and time value; otherwise, false. The default is false.
Remarks

When the ShowUpDown property is set to true, a spin button control (also known as an up-down control), rather than a drop-down calendar, is used to adjust time values. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value.

To display only time in a DateTimePickerCell, set the Format property to System.Windows.Forms.DateTimePickerFormat.Time, and the ShowUpDown property to true.

Example
The following code example shows how to customize a date time picker cell's behavior or appearance. This code example is part of a larger example provided for the DateTimePickerCell class.
DateTimePickerCell CreateShowTimeDateTimePickerCell()
        {
            DateTimePickerCell dateTimePickerCell1 = new DateTimePickerCell();

            dateTimePickerCell1.Format = DateTimePickerFormat.Time;

            dateTimePickerCell1.Value = DateTime.Now;
            
            dateTimePickerCell1.Size = new Size(120, 21);

            dateTimePickerCell1.ShowUpDown = true;

            return dateTimePickerCell1;
        }
Private Function CreateShowTimeDateTimePickerCell() As DateTimePickerCell
       Dim dateTimePickerCell1 As New DateTimePickerCell()

       dateTimePickerCell1.Format = DateTimePickerFormat.Time

       dateTimePickerCell1.Value = DateTime.Now

       dateTimePickerCell1.Size = New Size(120, 21)

       dateTimePickerCell1.ShowUpDown = True

       Return dateTimePickerCell1
   End Function
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DateTimePickerCell Class
DateTimePickerCell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.