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に属するDataGridViewRow

例外

rowIndex は -1 です。

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

注釈

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

適用対象

こちらもご覧ください