Aracılığıyla paylaş


XmlMappedRange.BeforeRightClick Olay

Ortaya çıkar, bir XmlMappedRange denetimidir sağ, varsayılan sağ tıklatmadan önce 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 için bir işleyici gösterir BeforeRightClick sağ tıklatma eylemi iptal olayı bir XmlMappedRange.Sağ için izin verilmeyen kullanıcı olay işleyicisi bildirir XmlMappedRangeve sonra ayarlar Cancel parametresi DocEvents_BeforeRightClickEventHandler olay işleyicisine true , böylece Microsoft Office Excel, sağ tıklatma eylemi iptal eder.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ı