GrapeCity.Win.MultiRow Namespace > DateTimePickerCell Class : ShowUpDown Property |
<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;}
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.
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
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