語言

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。

適用於

另請參閱