Control.Name Property
.NET Framework (current version)
Gets or sets the name of the control.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The Name property can be used at run time to evaluate the object by name rather than type and programmatic name. Because the Name property returns a String type, it can be evaluated in case-style logic statements (Select statement in Visual Basic, switch statement in Visual C# and Visual C++).
The following code example displays the Name of a control in a MessageBox when the control is added or removed from a form.
.NET Framework
Available since 1.1
Available since 1.1
Show: