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

一个属于指定索引处的 ContextMenuStripDataGridViewRow

例外

rowIndex 为 -1。

rowIndex 小于零或大于等于将控件中的行数减一得到的值。

注解

GetContextMenuStrip传递用于检索索引DataGridViewRow器的方法。 请勿对IndexrowIndex参数使用属性。 如果共享行, Index 则为 -1,该值为 rowIndex无效值。

适用于

另请参阅