Bookmark.Parent Özellik

Tanım

Denetimin üst nesnesini alır Bookmark .

public object Parent { get; }

Özellik Değeri

Object

Denetimin üst nesnesi Bookmark .

Örnekler

Aşağıdaki kod örneği, Bookmark ilk paragrafa metin içeren bir denetim ekler ve yer işaretinin üst öğesini bir ileti kutusunda görüntüler.

Bu örnek, belge düzeyinde özelleştirme içindir

private void BookmarkParent()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();

    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text";
    MessageBox.Show("The parent of bookmark1 is : " +
        bookmark1.Parent.ToString());

}
Private Sub BookmarkParent()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    Bookmark1.Text = "This is sample bookmark text"
    MessageBox.Show("The parent of bookmark1 is : " & _
        Bookmark1.Parent.ToString)

End Sub

Şunlara uygulanır