ShapeCollection.Item (Propiedad)

obtiene Shape en la ubicación indizado especificada en la colección.

Espacio de nombres:  Microsoft.VisualBasic.PowerPacks
Ensamblado:  Microsoft.VisualBasic.PowerPacks.Vs (en Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxis

'Declaración
Public Property Item ( _
    index As Integer _
) As Object
public Object this[
    int index
] { get; set; }
public:
virtual property Object^ Item[int index] {
    Object^ get (int index) sealed;
    void set (int index, Object^ value) sealed;
}
abstract Item : Object with get, set
override Item : Object with get, set
JScript no admite propiedades indizadas.

Parámetros

Valor de propiedad

Tipo: System.Object
Shape situado en la ubicación de índice especificada en ShapeCollection.

Implementaciones

IList.Item

Comentarios

Para recuperar Shape de ShapeCollection, haga referencia al objeto de colección utilizando un valor de índice concreto.El valor de índice del objeto ShapeCollection es un índice de base cero.

Ejemplos

El ejemplo siguiente utiliza Index de ShapeCollection para establecer el foco a una forma.Este ejemplo requiere tener Button, LineShape, OvalShape, y un control de RectangleShape en un formulario.

Private Sub Button1_Click() Handles Button1.Click
    ' Set the focus to the first shape (index 0).
    ShapeContainer1.Shapes.Item(0).Focus()
End Sub
private void button1_Click(System.Object sender, System.EventArgs e)
{
    // Set the focus to the first shape (index 0).
    Shape selectedShape = ((Shape) shapeContainer1.Shapes.get_Item(0));
    selectedShape.Focus();
}

Seguridad de .NET Framework

Vea también

Referencia

ShapeCollection Clase

Microsoft.VisualBasic.PowerPacks (Espacio de nombres)

Otros recursos

Introducción a los controles de líneas y formas (Visual Studio)

Cómo: Dibujar líneas con el control LineShape (Visual Studio)

Cómo: Dibujar formas con los controles OvalShape y RectangleShape (Visual Studio)