语言

DataGridViewColumnHeaderCell.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。

例外

rowIndex 不是 -1。

适用于

另请参阅