Aracılığıyla paylaş


XMLNodes.Deselect Olay

İmleci düğümlerden biri dışında hareket ettiğinde gerçekleşir XMLNodes koleksiyonu.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word (Microsoft.Office.Tools.Word.dll içinde)

Sözdizimi

'Bildirim
Event Deselect As ContextChangeEventHandler
event ContextChangeEventHandler Deselect

Açıklamalar

Deselect Olay farklı ContextLeave olay. Daha fazla bilgi için bkz. XMLNodes Denetimi.

Örnekler

Aşağıdaki kod örneği için olay işleyicilerini gösterir Select, Deselect, ContextEnter, ve ContextLeave olayları. Zaman Select ve Deselect olayları harekete geçirilen, olay işleyicilerini seçim kenarlıklarını çift çizgi ekleyip bağlı çift çizgiolay. Zaman ContextEnter ve ContextLeave olayları harekete geçirilen, olay işleyicilerini görüntü adlarını yeni seçilen düğüm ve durum iletileriönceden seçilen düğümü. Bu örnek, geçerli belge içerdiğini varsayar bir XMLNodes collection adlı SampleInsertNodes.

Private Sub SampleInsertNodes_Select(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ContextChangeEventArgs)


    e.Selection.Borders.OutsideLineStyle = _
        Word.WdLineStyle.wdLineStyleDouble
End Sub

Private Sub SampleInsertNodes_Deselect(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ContextChangeEventArgs)


    e.Selection.Borders.OutsideLineStyle = _
        Word.WdLineStyle.wdLineStyleNone
End Sub

Private Sub SampleInsertNodes_ContextEnter(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ContextChangeEventArgs)


    MessageBox.Show("You entered the node '" & _
        e.NewXMLNode.BaseName + "'.")
End Sub

Private Sub SampleInsertNodes_ContextLeave(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ContextChangeEventArgs)


    MessageBox.Show("You left the node '" & _
        e.OldXMLNode.BaseName + "'.")
End Sub
private void XMLNodesSelections()
{
    this.SampleInsertNodes.ContextEnter +=
        new Microsoft.Office.Tools.Word.ContextChangeEventHandler(
        SampleInsertNodes_ContextEnter);

    this.SampleInsertNodes.ContextLeave +=
        new Microsoft.Office.Tools.Word.ContextChangeEventHandler(
        SampleInsertNodes_ContextLeave);

    this.SampleInsertNodes.Select +=
        new Microsoft.Office.Tools.Word.ContextChangeEventHandler(
        SampleInsertNodes_Select);

    this.SampleInsertNodes.Deselect +=
        new Microsoft.Office.Tools.Word.ContextChangeEventHandler(
        SampleInsertNodes_Deselect);
}

void SampleInsertNodes_Select(object sender,
    Microsoft.Office.Tools.Word.ContextChangeEventArgs e)
{
    e.Selection.Borders.OutsideLineStyle =
        Word.WdLineStyle.wdLineStyleDouble;
}

void SampleInsertNodes_Deselect(object sender,
    Microsoft.Office.Tools.Word.ContextChangeEventArgs e)
{
    e.Selection.Borders.OutsideLineStyle =
        Word.WdLineStyle.wdLineStyleNone;
}

void SampleInsertNodes_ContextEnter(object sender,
    Microsoft.Office.Tools.Word.ContextChangeEventArgs e)
{
    MessageBox.Show("You entered the node '" +
        e.NewXMLNode.BaseName + "'.");
}

void SampleInsertNodes_ContextLeave(object sender,
    Microsoft.Office.Tools.Word.ContextChangeEventArgs e)
{
    MessageBox.Show("You left the node '" +
        e.OldXMLNode.BaseName + "'.");
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

XMLNodes Arabirim

Microsoft.Office.Tools.Word Ad Alanı