Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DateTimeUpDown

XceedBoucherS edited this pageMar 11, 2020 ·4 revisions

DateTimeUpDown

Derives from Xceed.Wpf.Toolkit.Core.Primitives.DateTimeUpDownBase

The DateTimeUpDown control allows a user to increment or decrement a DateTime using button spinners, up/down keys, or the mouse wheel.

Usage

To use the DateTimeUpDown control simply create an instance of the control in your XAML file, specify the DateTimeUpDown.Value property, and select a Format by setting the DateTimeUpDown.Format property.

<xctk:DateTimeUpDown Value="{Binding LastUpdated}" Format="FullDateTime" />

Modifying the DateTime Value

To increment or decrement the DateTime value, simply select the DateTime part you wish to modify and then interact with either the mouse wheel, spinner buttons, or updown arrow keys. The following image shows what the different DateTime parts look like when you select them.

Depending on your DateTimeUpDown.Format, you may or maynot have all DateTime parts available. You can also get the formatted DateTimeUpDown.Value by using the DateTimeUpDown.Text property.

Formats

FormatExample
FullDateTime
LongDate
LongTime
MonthDay
RFC1123
ShortDate
ShortTime
SortableDateTime
UniversalSortableDateTime
YearMonth

Custom Format

If the available formats don't fit your needs you can create your own custom format. Simply specify the Format property as Custom and then provide a FormatString.

<extToolkit:DateTimeUpDown Format="Custom" FormatString="hh:mm tt" Value="13:30" />

Properties

PropertyDescription
AllowSpinGets or sets the ability to perform increment/decrement operations via the keyboard, button spinners, or mouse wheel. (Inherited from UpDownBase)
AllowTextInputDetermines if the editable part of the control can be edited. The editable part does not include buttons or spinners, it is typically the text part.
ClipValueToMinMaxGets or sets if the value should be clipped when minimum/maximum is reached. (Inherited from UpDownBase)
CultureInfoGets or sets the current CultureInfo. (Inherited from InputBase)
DefaultValueGets or sets the value to use when theText is null or empty. (Inherited from UpDownBase)
DisplayDefaultValueOnEmptyTextGets or sets if theDefaultValue should be displayed when theText is empty. (Inherited from UpDownBase)
FormatGets or sets a DateTimeFormat value representing the format to be used (e.g., FullDateTime, LongDate, etc.).
FormatStringGets or sets the display format to use whenFormat is set toCustom (e.g., "hh:mm tt").
IsReadOnlyGets or sets a value indicating whether the control is read only. (Inherited from InputBase)
KindGets or sets a value indicating whether a DateTime object represents a local time, a Coordinated Universal Time (UTC), or is not specified as either local time or UTC. NOTE: Setting this property fixes a bug where losing focus on the DateTimeUpDown was incrementing time in UTC. It also fixes a bug where specifying a UTC Date was changing the date's Kind property to UnSpecified or Local.
MaximumGets or sets the maximum allowed value. (Inherited from UpDownBase)
MinimumGets or sets the minimum allowed value. (Inherited from UpDownBase)
MouseWheelActiveOnFocusGets or sets if the control must have focus in order for the mouse wheel to increment/decrement the value. True by default. (Inherited from UpDownBase)
ShowButtonSpinnerGets or sets if the button spinners are visible. (Inherited from UpDownBase)
SpinnerGets or sets the spinner to use in the control. (Inherited from UpDownBase)
TextGets or sets the formated string representation of the value. (Inherited from InputBase)
TextAlignmentGets or sets the alignment of the value ofText. (Inherited from InputBase)
TextBoxGets or sets the TextBox to use in the control. (Inherited from UpDownBase)
UpdateValueOnEnterKeyGets or sets a value indicating whether the synchronization between "Value" and "Text" should be done only on the Enter key press (and lost focus). (Inherited from UpDownBase)
ValueGets or sets the numeric value. (Inherited from UpDownBase)
WatermarkGets or sets the object to use as a watermark if theValue is null. (Inherited from InputBase)
WatermarkTemplateGets or sets the DataTemplate to use for theWatermark. (Inherited from InputBase)

Events

EventDescription
InputValidationErrorRaised when theText cannot be converted to a validValue. (Inherited from UpDownBase)
ValueChangedRaised when theValue changes. (Inherited from UpDownBase)

Methods

MethodDescription
SelectAllSelect all the Text from the TextBox in the DateTimeUpDown.

Support this project, check out thePlus Edition.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp