DataGridViewRowHeaderCell.GetInheritedContextMenuStrip(Int32) 方法

定义

检索指定行的继承快捷菜单。

public:
 override System::Windows::Forms::ContextMenuStrip ^ GetInheritedContextMenuStrip(int rowIndex);
public override System.Windows.Forms.ContextMenuStrip GetInheritedContextMenuStrip(int rowIndex);
public override System.Windows.Forms.ContextMenuStrip? GetInheritedContextMenuStrip(int rowIndex);
override this.GetInheritedContextMenuStrip : int -> System.Windows.Forms.ContextMenuStrip
Public Overrides Function GetInheritedContextMenuStrip (rowIndex As Integer) As ContextMenuStrip

参数

rowIndex
Int32

要获取的 ContextMenuStrip 行的索引。 索引必须 -1 才能指示列标题行。

返回

如果存在行,则 ContextMenuStrip 为行;否则为 ContextMenuStrip 继承自 DataGridView

例外

单元格的属性值 DataGridView 不是 null ,指定的 rowIndex 值小于 0 或大于控件中的行数减 1。

适用于

另请参阅