DataGridViewRow.GetContextMenuStrip(Int32) メソッド

定義

行のショートカット メニューを取得します。

public:
 System::Windows::Forms::ContextMenuStrip ^ GetContextMenuStrip(int rowIndex);
public System.Windows.Forms.ContextMenuStrip GetContextMenuStrip (int rowIndex);
member this.GetContextMenuStrip : int -> System.Windows.Forms.ContextMenuStrip
Public Function GetContextMenuStrip (rowIndex As Integer) As ContextMenuStrip

パラメーター

rowIndex
Int32

現在の行のインデックス。

戻り値

ContextMenuStrip

指定したインデックス位置の ContextMenuStrip に属する DataGridViewRow

例外

rowIndex は、-1 です。

rowIndex が 0 未満か、コントロールの行数から 1 を引いた値以上です。

注釈

GetContextMenuStrip 取得するために使用したインデクサーのメソッドを DataGridViewRow渡します。 パラメーターにはプロパティrowIndexIndex使用しないでください。 行が共有されている場合、 Index -1 は無効な値 rowIndexです。

適用対象

こちらもご覧ください