TFS 2017 (Hosted XML) | TFS 2015
This topic applies to team project customization for the On-premises XML process model using the old form layout. For the Hosted XML process model and the new form layout, see WebLayout and Control elements.
For an overview of process models, see Customize your work tracking experience.
If you are designing a work item form from the ground up, you might want to add the control to attach files to the work item. In general, each work item form contains a tab that supports the attachment of files, such as an email thread, a document, an image, a log file, or another type of file.
AttachmentsControl``Type attribute lets you enable users to see and manage the file attachments of a work item. By adding this control to a work item form, you can open, add, and remove file attachments. In the following example, a tab that is labeled "Attachments" is added to a work item form by using all the controls that are shown.
<Tab Label="Attachments"> <Control Type="AttachmentsControl" LabelPosition="Top" /> </Tab>
You must choose or attach a file before the buttons to open an attachment (), save a copy ( Save Copy), and delete an attachment () become available. For more information, see Attachment control and fields.
You can control the spacing and size of the attachment control by specifying the attributes in the following table.
|Attribute||Description||Pattern value example|
||Optional. String of the form (Width, Height). This value specifies the minimum size for the form itself. When the container control is smaller than this size, horizontal and vertical scrollbars appear.||(100,100)|
||Optional. String of the form (left, top, right, bottom) that specifies, in pixels, the amount of space around the control and between the control and its neighbors. You can vary the amount of space on each side.||(2,0,2,0)|
||Optional. String of the form (left, top, right, bottom) that specifies, in pixels, the amount of space around the outside border of the control and around the inside border. You can vary the amount of space on each side.||(2,0,2,0)|
||Optional. Specifies the visible text on the form that identifies the control.
You can leave the label unspecified when the attachment control is the only control on a tab. The tab label is sufficient to identify the control.
|Specify a string of no more than 80 characters.|