Shape.Name Property

 

Gets or sets the name of a line or shape control.

Namespace:   Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

[BrowsableAttribute(false)]
public string Name { get; set; }
public:
[BrowsableAttribute(false)]
property String^ Name {
    String^ get();
    void set(String^ value);
}
[<BrowsableAttribute(false)>]
member Name : string with get, set
<BrowsableAttribute(False)>
Public Property Name As String

Property Value

Type: System.String

The name of the control. The default is an empty string ("").

Remarks

When a line or shape control is added at design time, the name property is assigned a value that consists of the type of control plus a number. For example, the first OvalShape control added would be named "OvalShape1" and the second would be named "OvalShape2".

For line or shape controls created at run time with the New method, the Name property is an empty string ("").

Examples

The following example sets the Name property of an OvalShape control that is created by using the New method.

OvalShape os = new OvalShape();
ShapeContainer sc = new ShapeContainer();
sc.Parent = this;
os.Parent = sc;
// Assign a value to the Name property.
os.Name = "NewOval1";
Dim os As New OvalShape
Dim sc As New ShapeContainer
sc.Parent = Me
os.Parent = sc
' Assign a value to the Name property.
os.Name = "NewOval1"

See Also

Shape Class
Microsoft.VisualBasic.PowerPacks Namespace
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)
Introduction to the Line and Shape Controls (Visual Studio)

Return to top