Bookmark.BeforeRightClick Olay

Tanım

Bir Bookmark denetime sağ tıklandığında, varsayılan sağ tıklama eyleminden önce gerçekleşir.

event Microsoft.Office.Tools.Word.ClickEventHandler BeforeRightClick;

Olay Türü

ClickEventHandler

Örnekler

Aşağıdaki kod örneği, belgeye bir Bookmark denetim ekler ve sonra bir BeforeRightClick olay işleyicisi oluşturur. BookmarkDenetime sağ tıklandığında, yer işareti içindeki metin panoya kopyalanır.

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

Microsoft.Office.Tools.Word.Bookmark bookmark3;

private void BookmarkBeforeRightClick()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    bookmark3 = this.Controls.AddBookmark(this.Paragraphs[1]
        .Range, "bookmark3");
    bookmark3.Text = "This is a sample bookmark.";
    bookmark3.BeforeRightClick += new Microsoft.Office.Tools
        .Word.ClickEventHandler(bookmark3_BeforeRightClick);
}

void bookmark3_BeforeRightClick(object sender, 
    Microsoft.Office.Tools.Word.ClickEventArgs e)
{
    bookmark3.Copy();
    e.Cancel = true;
}
WithEvents Bookmark3 As Microsoft.Office.Tools.Word.Bookmark

Private Sub BookmarkBeforeRightClick()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Bookmark3 = Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark3")
    Bookmark3.Text = "This is a sample bookmark."
End Sub

Private Sub Bookmark3_BeforeRightClick(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ClickEventArgs) _
    Handles Bookmark3.BeforeRightClick
    Bookmark3.Copy()
    e.Cancel = True
End Sub

Açıklamalar

Çakışan denetimlere sağ tıklanması, çakışan Bookmark yer işaretlerinin her birinde olay oluşturur.

Şunlara uygulanır