Share via


DataGridViewRow.GetContextMenuStrip(Int32) 方法

定義

取得資料列的捷徑功能表。

public:
 System::Windows::Forms::ContextMenuStrip ^ GetContextMenuStrip(int rowIndex);
public System.Windows.Forms.ContextMenuStrip GetContextMenuStrip (int rowIndex);
member this.GetContextMenuStrip : int -> System.Windows.Forms.ContextMenuStrip
Public Function GetContextMenuStrip (rowIndex As Integer) As ContextMenuStrip

參數

rowIndex
Int32

目前資料列的索引。

傳回

ContextMenuStrip

ContextMenuStrip,屬於在指定之索引處的 DataGridViewRow

例外狀況

rowIndex 為 -1。

rowIndex 小於零或是大於或等於控制項中的資料列數。

備註

GetContextMenuStrip傳遞您用來擷取 的 DataGridViewRow 索引子方法。 請勿將 Index 屬性用於 rowIndex 參數。 如果共用資料列, Index 則 為 -1,這是 的 rowIndex 無效值。

適用於

另請參閱