Name Property

       

Returns the name used in code to identify a SysInfo control.

Syntax

object.Name

The object placeholder represents an object expression that evaluates to an object in the Applies To list. If object is omitted, the form associated with the active form module is assumed to be object.

Remarks

The default name for new objects is the kind of object plus a unique integer. For example, the first new form object is Form1, a new SysInfo control is SysInfo1, and the third TextBox control you create on a form is Text3.

An object's Name property must start with a letter and can be a maximum of 40 characters. It can include numbers and underline (_) characters but can't include punctuation or spaces. Forms can't have the same name as another public object such as Clipboard, Screen, or App. Although the Name property setting can be a keyword, property name, or the name of another object, this can create conflicts in your code.

You can create an array of controls of the same type by setting the Name property to the same value. For example, when you set the name of all option buttons in a group to MyOpt, Visual Basic assigns unique values to the Index property of each control to distinguish it from others in the array. Two controls of different types can't share the same name.