Udostępnij za pośrednictwem


ListObject.Parent Property (2007 System)

Gets the parent object of the ListObject control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Parent As Object
'Usage
Dim instance As ListObject 
Dim value As Object 

value = instance.Parent
[BrowsableAttribute(false)]
public Object Parent { get; }
[BrowsableAttribute(false)]
public:
property Object^ Parent {
    Object^ get ();
}
public function get Parent () : Object

Property Value

Type: System.Object
The parent object of the ListObject control.

Examples

The following code example creates a ListObject and then displays the name of its parent object in a message.

This example is for a document-level customization.

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());
}

.NET Framework Security

See Also

Reference

ListObject Class

ListObject Members

Microsoft.Office.Tools.Excel Namespace