Aracılığıyla paylaş


XmlMappedRange.BeforeRightClick Olay

Oluşur, bir XmlMappedRange Denetim sağ tıklatıldığında, varsayılan önce sağ eylem.

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

Sözdizimi

'Bildirim
Event BeforeRightClick As DocEvents_BeforeRightClickEventHandler
event DocEvents_BeforeRightClickEventHandler BeforeRightClick

Örnekler

Aşağıdaki kod bir işleyicisi gösterir BeforeRightClick sağ tıklatma eylemi iptal eden olay bir XmlMappedRange. Sağ için izin verilmeyen kullanıcı olay işleyicisi bildirir XmlMappedRangeve Cancel parametresi DocEvents_BeforeRightClickEventHandler olay işleyicisine true , Microsoft Office Excel iptal eder sağ tıklatma eylemi. Bu kod örneği, geçerli çalışma sayfasının içerdiğini varsayar bir XmlMappedRange adlı CustomerLastNameCell.

Sub CustomerLastNameCell_BeforeRightClick(ByVal Target As Excel.Range, _
    ByRef Cancel As Boolean) Handles CustomerLastNameCell.BeforeRightClick
    MsgBox("Right-clicking in this range is not allowed.")
    Cancel = True
End Sub
private void XmlMappedRange_BeforeRightClick()
{
    this.CustomerLastNameCell.BeforeRightClick += 
        new Excel.DocEvents_BeforeRightClickEventHandler(
        CustomerLastNameCell_BeforeRightClick);
}

void CustomerLastNameCell_BeforeRightClick(Excel.Range Target, 
    ref bool Cancel)
{
    MessageBox.Show("Right-clicking in this range " +
        " is not allowed.");
    Cancel = true;
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

XmlMappedRange Arabirim

Microsoft.Office.Tools.Excel Ad Alanı