مشاركة عبر


DocumentBase.SelectionChange الحدث

يحدث عند تغير تحديد في نافذة مستند.

مساحة الاسم:  Microsoft.Office.Tools.Word
التجميع:  Microsoft.Office.Tools.Word.v4.0.Utilities (في Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

بناء الجملة

'إقرار
Public Event SelectionChange As SelectionEventHandler
public event SelectionEventHandler SelectionChange

أمثلة

يلي تعليمات برمجية المثال يعرض رسالة تشير إلى أنه تم تم تغييره تحديد عند تم تغييره تحديد داخل مستند. إلى لاستخدام هذا المثال، قم بتشغيلها من ThisDocumentالفئة في مشروع المستوى مستند.

Private Sub DocumentSelectionChange()
    AddHandler Me.SelectionChange, AddressOf ThisDocument_SelectionChange
End Sub

Private Sub ThisDocument_SelectionChange(ByVal sender As Object, ByVal e As Microsoft.Office. _
    Tools.Word.SelectionEventArgs)
    MessageBox.Show("The selection in the document has changed.")
End Sub
private void DocumentSelectionChange()
{
    this.SelectionChange += new Microsoft.Office.Tools.Word.SelectionEventHandler(ThisDocument_SelectionChange);
}

void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
{
    MessageBox.Show("The selection in the document has changed.");
}

أمن NET Framework.

راجع أيضًَا

المرجع

DocumentBase الفئة

DocumentBase الأعضاء

Microsoft.Office.Tools.Word مساحة الاسم