ListObject.Parent (Propiedad)

Obtiene el objeto primario del control ListObject.

Espacio de nombres:  Microsoft.Office.Tools.Excel
Ensamblado:  Microsoft.Office.Tools.Excel (en Microsoft.Office.Tools.Excel.dll)

Sintaxis

'Declaración
ReadOnly Property Parent As Object
    Get
Object Parent { get; }

Valor de propiedad

Tipo: System.Object
Objeto primario del control ListObject.

Ejemplos

En el ejemplo de código siguiente se crea ListObject y, a continuación, se muestra el nombre de su objeto primario en un mensaje.

Se trata de un ejemplo para una personalización en el nivel del documento.

    Private Sub ListObject_Parent()
        Dim List1 As Microsoft.Office.Tools.Excel.ListObject = _
            Me.Controls.AddListObject(Me.Range("A1", "C4"), "List1")

        Dim List1Parent As Excel.Worksheet = _
            CType(List1.Parent, Excel.Worksheet)
        MessageBox.Show("The parent of List1 is " & _
            List1Parent.Name.ToString())
    End Sub

private void ListObject_Parent()
{
    Microsoft.Office.Tools.Excel.ListObject list1 =
        this.Controls.AddListObject(
        this.Range["A1", "C4"], "list1");

    Excel.Worksheet list1Parent = (Excel.Worksheet)list1.Parent;
    MessageBox.Show("The parent of list1 is " +
        list1Parent.Name.ToString());
}

Seguridad de .NET Framework

Vea también

Referencia

ListObject Interfaz

Microsoft.Office.Tools.Excel (Espacio de nombres)