ListObject.BeforeRightClick Olay

Oluşur, ListObject 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 örneği oluşturur bir ListObject ve BeforeRightClick olay işleyicisi.Liste nesnesi gelir, liste nesnesinin veriye bağlı olup olmadığını belirten bir ileti görüntülenir.

Belge düzeyi özelleştirmesinde sürümüdür.

    WithEvents List3 As Microsoft.Office.Tools.Excel.ListObject

    Private Sub ListObject_BeforeRightClick()
        List3 = Me.Controls.AddListObject( _
            Me.Range("A1", "C4"), "List3")
    End Sub


    Sub List3_BeforeRightClick(ByVal Target As _
        Microsoft.Office.Interop.Excel.Range, _
        ByRef Cancel As Boolean) Handles List3.BeforeRightClick
        MessageBox.Show("Data binding is " & List3.IsBinding)
        Cancel = True
    End Sub

Microsoft.Office.Tools.Excel.ListObject list3;
private void ListObject_BeforeRightClick()
{
    list3 = this.Controls.AddListObject(
        this.Range["A1", "C4"], "list3");
    list3.BeforeRightClick += new 
        Microsoft.Office.Interop.Excel.
        DocEvents_BeforeRightClickEventHandler(
        list3_BeforeRightClick);
}

void list3_BeforeRightClick(Microsoft.Office.Interop.Excel.Range 
    Target, ref bool Cancel)
{
    MessageBox.Show("Data binding is " + list3.IsBinding);
    Cancel = true;
}

Bir uygulama düzeyi eklentisi değildir.

    WithEvents List3 As ListObject

    Private Sub ListObject_BeforeRightClick()
        Dim NativeWorksheet As Microsoft.Office.Interop.Excel.Worksheet =
            Me.Application.Worksheets(1)
        Dim vstoWorksheet As Microsoft.Office.Tools.Excel.Worksheet =
                Globals.Factory.GetVstoObject(NativeWorksheet)
        List3 = vstoWorksheet.Controls.AddListObject( _
            vstoWorksheet.Range("A1", "C4"), "List3")
    End Sub


    Sub List3_BeforeRightClick(ByVal Target As  _
        Microsoft.Office.Interop.Excel.Range, _
        ByRef Cancel As Boolean) Handles List3.BeforeRightClick
        System.Windows.Forms.MessageBox.Show("Data binding is " & List3.IsBinding)
        Cancel = True
    End Sub

ListObject list3;
private void ListObject_BeforeRightClick()
{
    Worksheet vstoWorksheet = 
        Globals.Factory.GetVstoObject(this.Application.ActiveWorkbook.Worksheets[1]);
    list3 = vstoWorksheet.Controls.AddListObject(
        vstoWorksheet.Range["A1", "C4"], "list3");
    list3.BeforeRightClick += new
        Excel.DocEvents_BeforeRightClickEventHandler(
        list3_BeforeRightClick);
}

void list3_BeforeRightClick(Microsoft.Office.Interop.Excel.Range
    Target, ref bool Cancel)
{
    System.Windows.Forms.MessageBox.Show("Data binding is " + list3.IsBinding);
    Cancel = true;
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

ListObject Arabirim

Microsoft.Office.Tools.Excel Ad Alanı