Control XML element reference
You use the Control element to define a work item field, text, hyperlink, or other control element to display in a work item form. For examples of how to use this element, see Specify work item form controls and Design the work item form.
Schema Hierarchy
<xs:element name="Control" type="ControlType" minOccurs="0"/>
<Control FieldName="FieldName" Type="AttachmentsControl | DateTimeControl | FieldControl |
HtmlFieldControl | LabelControl | LinksControl | WebpageControl | WorkItemClassificationControl |
WorkItemLogControl" ControlFontSize="FontSize" EmptyText="TextString"
Label="LabelText" LabelPosition="Top | Bottom | Left | Right"
Padding="(top, bottom, left, right)"
Margin="(top, bottom, left, right)" ReadOnly="True | False" MinimumSize="(width,height)"
Name="InstanceName" >
<LabelText> . . . </LabelText>
<Link> . . . </Link>
<LinksControlOptions> . . . </LinksControlOptions>
<WebpageControlOptions> . . . </WebpageControlOptions>
</Control>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute |
Description |
---|---|
FieldName |
Optional Control attribute. Specifies the work item field with which the control is associated. The attribute type is typelib:ReferenceFieldName. Minimum length: 1; maximum length: 70. Pattern value: ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)+$ Pattern value example: Company.Division.IssueType |
Type |
Required Control attribute. Specifies the data type of the control. The attribute type is ValidControlsType Simple Type. Specify a string from one of the following built-in types:
For more information, see Specify work item form controls. Note You can use a custom control by setting the Type attribute to a custom value. Any control whose Type value does not match the name of a built-in type is considered a custom control. For more information, see the Microsoft Web site: Work Item Tracking Custom Controls. |
ControlFontSize |
Optional Control attribute. Specifies the font size of the field name or label on the form. Valid values of FontSize: small, normal, large, xlarge, and xxlarge. |
EmptyText |
Optional Control attribute. Specifies a text string between 1 and 255 characters in length that appears when a field is empty. |
Label |
Optional Control attribute. Specifies the visible text on the form that identifies the control. Specify a string of no more than 80 characters. |
LabelFontSize |
Specifies the font size of the label on the form. Valid values for FontSize: small, normal, large, xlarge, and xxlarge. |
LabelPosition |
Optional Control attribute. Specifies the position of the label relative to the control data. Specify a string from one of the following values:
|
Padding |
Optional Control attribute. Specifies the amount of space in pixels around the inside border of the control which corresponds to the top, bottom, left, and right spaces. The attribute type is SizeType. Pattern value: ^\(\d+\,\d+\,\d+\,\d+\)$ Pattern value example: (2,0,2,0) |
Margin |
Optional Control attribute. Specifies the amount of space in pixels around the outside border of the control which corresponds to the top, bottom, left, and right spaces. The attribute type is SizeType. Pattern value: ^\(\d+\,\d+\,\d+\,\d+\)$ Pattern value example: (2,0,2,0) |
ReadOnly |
Optional Control attribute. Specifies that the field is read-only. The attribute type is ReadOnlyType. Specify a string from one of the following values:
|
MinimumSize |
Optional Control attribute. Specifies the minimum size in pixels that the control should occupy in the form. The syntax is specified in (width,height). The attribute type is SizeType. Pattern value: ^\(\d+\,\d+\)$ Pattern value example: (100,100) Note If you do not have sufficient vertical space, then a scrollbar appears to keep its minimum size. Without this attribute, the controls are drawn with their default sizes, unless controls in other tabs take more space. The overall size of any one form control depends on the size of the largest form area or tab. |
Name |
Optional Control attribute. Identifies a control uniquely. The Name is important if more than one control on the form is associated with the same work item field. The attribute type is xs:string. Note You use the Name attribute when you want to have the same field displayed in more than one location on the form. You specify a unique value for the Name attribute for both control entries so that the system identifies each control uniquely. It is useful to show the same control in various locations based on the context of tabs. |
NumberFormat |
Optional Control attribute that is valid only when it is used with FieldControl. Specifies the characters that you can enter in the field control. Valid values that you can use are as follows:
|
MaxLength |
Optional Control attribute that is valid only when it is used with FieldControl. Specifies the maximum length of allowed characters for a field control. The attribute type is xs:integer. |
Format |
Optional Control attribute that is valid only when it is used with DateTimeControl. Specifies the format for the date-time field corresponding to one of the values of the DateTimePickerFormat enum. Valid values that you can use are as follows:
For more information, see the Microsoft Web site: DateTimePickerFormat Enumeration. |
CustomFormat |
Optional Control attribute that is valid only when it is used with DateTimeControl and the Format attribute. Specifies the custom format for the date-time field corresponding to the syntax defined for the DateTimePicker.CustomFormat property. For more information, see the Microsoft Web site: DateTimePicker.CustomFormat Property. |
Child Elements
Element |
Description |
---|---|
Optional element. You can specify this element when the Type attribute is specified as FieldControl or LabelControl. Container element for specifying the text, hyperlink, and position of a field or label whose text is partly associated with a hyperlink. For more information, see LabelText and Text XML Elements Reference and Provide help text, hyperlinks, or web content on a work item form. |
|
Optional element. You can specify this element when the Type attribute is specified as FieldControl or LabelControl. Defines the hyperlink for a field or label. For more information, see Link and Param XML Elements Reference and Provide help text, hyperlinks, or web content on a work item form. |
|
Optional element. You can specify this element when the Type attribute is specified as LinksControl. Defines the link filters and layout of column fields to display the list of links. For more information, see Define link controls to restrict link relationships. |
|
Optional element. You can specify this element when the Type attribute is WebpageControl. Specifies the controls that govern loading the Web page target in the work item form. For more information, see WebpageControlOptions XML Elements Reference and Provide help text, hyperlinks, or web content on a work item form. |
|
anyAttribute |
Optional element. Optional. Control is extensible through use of the anyAttribute element. |
Parent Elements
Element |
Description |
---|---|
Required. Defines how to display the elements on the work item form. |
|
Column Element |
Required. Defines columns for the form. |
Tab Element |
Required. Defines a tab for the form. |
Remarks
Control is an optional child element of Layout, Column, and Tab.
Layout and Column indicators:
minOccurs = "0"
maxOccurs = "1"
Tab indicators:
minOccurs = "0"
maxOccurs = "unbounded"
To implement a custom control, you must specify the name of the control for the Type attribute. For more information, see the Microsoft Web site: Work Item Tracking Custom Controls.
For an example of each control type, see Specify work item form controls.
Example
<Control Type=" WorkItemClassificationControl " FieldName="System.AreaPath"
Label="Area" LabelPosition="Left" Padding="(2,0,2,0)" Margin="(2,2,2,2)" />
Element Information
Namespace |
https://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef |
Schema Name |
Work Item Type Definition |
Validation File |
WorkItemTypeDefinition.xsd |
Element Type |
ControlType Complex Type |
Can Be Empty |
Not applicable |
See Also
Concepts
Design and customize a work item form [redirected]