Tag

Returns or sets an expression that stores any extra data needed for your program. Unlike other properties, the value of the Tag property is not used by Visual Basic; you can use this property to identify objects.

Syntax

object.Tag [= expression]

The parts of the Tag property syntax are described in the following table.

Part Description
object An object expression that evaluates to an object.
expression A string expression identifying the object. The default is a zero-length string ("").

Remarks

You can use this property to assign an identification string to an object without affecting any of its other property settings or causing side effects. The Tag property is useful when you need to check the identity of a control that is passed as a variable to a procedure.

Tip When you create a new instance of a form, assign a unique value to the Tag property.