DataGridViewColumnHeaderCell.GetInheritedContextMenuStrip(Int32) 方法

定义

检索指定行的继承快捷菜单。Retrieves the inherited shortcut menu for the specified row.

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 的行的索引。The index of the row to get the ContextMenuStrip of. 索引必须为 -1,以指示列标头所在的行。The index must be -1 to indicate the row of column headers.

返回

ContextMenuStrip

列标头的 ContextMenuStrip(如果存在);否则为从 ContextMenuStrip 继承的 DataGridViewThe ContextMenuStrip of the column headers if one exists; otherwise, the ContextMenuStrip inherited from DataGridView.

例外

rowIndex 不是 -1。rowIndex is not -1.

适用于

另请参阅