DataGridViewHeaderCell.GetInheritedContextMenuStrip(Int32) 方法

定义

获取标头单元格的快捷菜单。Gets the shortcut menu of the header cell.

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

被该实现所忽略。Ignored by this implementation.

返回

ContextMenuStrip

如果 ContextMenuStripDataGridViewHeaderCell 分配有快捷菜单,则为 DataGridView;否则为 nullA ContextMenuStrip if the DataGridViewHeaderCell or DataGridView has a shortcut menu assigned; otherwise, null.

注解

如果没有 DataGridViewHeaderCell 快捷菜单,则 DataGridViewHeaderCell 将从继承快捷菜单 DataGridViewIf the DataGridViewHeaderCell does not have a shortcut menu, the DataGridViewHeaderCell will inherit the shortcut menu from the DataGridView. 如果 DataGridView 还没有快捷菜单,则该 GetInheritedContextMenuStrip 方法将返回 nullIf the DataGridView also does not have a shortcut menu, then the GetInheritedContextMenuStrip method will return null.

适用于

另请参阅