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 Property Name As String
Get
Set
'الاستخدام
Dim instance As Shape
Dim value As String
value = instance.Name
instance.Name = value
[BrowsableAttribute(false)]
public string Name { get; set; }
[BrowsableAttribute(false)]
public:
property String^ Name {
String^ get ();
void set (String^ value);
}
[<BrowsableAttribute(false)>]
member Name : string with get, set
function get Name () : String
function set Name (value : 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.
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"
OvalShape os = new OvalShape();
ShapeContainer sc = new ShapeContainer();
sc.Parent = this;
os.Parent = sc;
// Assign a value to the Name property.
os.Name = "NewOval1";
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks Namespace
Other Resources
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)