ApplicationContext.Tag Property

 

Gets or sets an object that contains data about the control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[BindableAttribute(true)]
[TypeConverterAttribute(typeof(StringConverter))]
public object Tag { get; set; }

Property Value

Type: System.Object

An Object that contains data about the control. The default is null.

Any type derived from the Object class can be assigned to this property. If the Tag property is set through the Windows Forms designer, only text can be assigned.

A common use for the Tag property is to store data that is closely associated with the control. For example, if you have a control that displays information about a customer, you might store a DataSet that contains the customer's order history in that control's Tag property so the data can be accessed quickly.

.NET Framework
Available since 2.0
Return to top
Show: