Partilhar via


Unit Element (Spinner)

Applies to: SharePoint Foundation 2010

Defines a unit for use within the spinner control.

<Unit
  Name="Text"
  MinimumValue="Decimal"
  MaximumValue="Decimal"
  DecimalDigits="Integer"
  Interval="Double"
/>

Attributes

Attribute

Description

Name

Optional. The name of the unit, such as inches, pixels, or percent.

MinimumValue

Optional. The minimum acceptable value.

MaximumValue

Optional. The maximum acceptable value.

DecimalDigits

Optional. The number of decimal digits to display.

Interval

Optional. The amount by which the value should be incremented or decremented.

Child Elements

UnitAbbreviation

Parent Elements

Spinner

Occurrences

Minimum: 1

Maximum: unbounded

Example

The following XML example defines a spinner control that contains several units.

<Spinner
   Id="Ribbon.Table.Layout.Properties.TableWidth"
   DefaultUnit="inch"
   DefaultValue="1.5"
   AltUpArrow="$Resources:core,cui_spnUpAlt;"
   AltDownArrow="$Resources:core,cui_spnDownAlt;"
   AccelerationInterval="125"
   MultiplierInterval="2000"
   Command="SetTableWidth"
   ImeEnabled="false"
   QueryCommand="QueryTableWidth"
   ToolTipTitle="$Resources:core,LabelTableWidth;"
   ToolTipDescription="$Resources:core,cui_stt_ButWidthHeightMenuTableWidthTooltip;"
   Sequence="30"
   TemplateAlias="o1"
>
  <Unit
      Name="inch"
      MinimumValue="0.1"
      MaximumValue="200"
      DecimalDigits="1"
      Interval="0.1"
  >
    <UnitAbbreviation Value="in" />
    <UnitAbbreviation Value="&quot;"/>
  </Unit>
  <Unit
      Name="pixel"
      MinimumValue="1"
      MaximumValue="2000"
      DecimalDigits="0"
      Interval="5"
  >
    <UnitAbbreviation Value="px" />
  </Unit>
  <Unit
      Name="centimeter"
      MinimumValue="0.1"
      MaximumValue="500"
      DecimalDigits="1"
      Interval="0.5"
  >
    <UnitAbbreviation Value="cm" />
  </Unit>
  <Unit
      Name="percent"
      MinimumValue="1"
      MaximumValue="100"
      DecimalDigits="0"
      Interval="1"
  >
    <UnitAbbreviation Value="%" />
  </Unit>
</Spinner>