DataGridViewCell.ContextMenuStrip プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewCell.ContextMenuStrip プロパティの意味・解説 

DataGridViewCell.ContextMenuStrip プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

セル関連付けられたショートカット メニュー取得または設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Overridable Property
 ContextMenuStrip As ContextMenuStrip
Dim instance As DataGridViewCell
Dim value As ContextMenuStrip

value = instance.ContextMenuStrip

instance.ContextMenuStrip = value
public virtual ContextMenuStrip ContextMenuStrip { get;
 set; }
public:
virtual property ContextMenuStrip^ ContextMenuStrip {
    ContextMenuStrip^ get ();
    void set (ContextMenuStrip^ value);
}
/** @property */
public ContextMenuStrip get_ContextMenuStrip ()

/** @property */
public void set_ContextMenuStrip (ContextMenuStrip
 value)
public function get ContextMenuStrip
 () : ContextMenuStrip

public function set ContextMenuStrip
 (value : ContextMenuStrip)

プロパティ
セル関連付けられた ContextMenuStrip。

解説解説

このプロパティ通常セル右クリックしたときに表示されるショートカット メニュー示します

DataGridView コントロールの DataSource プロパティ設定されている場合、または VirtualMode プロパティtrue場合ContextMenuStrip プロパティの値を取得すると、コントロールの CellContextMenuStripNeeded イベント発生しイベント ハンドラ指定された DataGridViewCellContextMenuStripNeededEventArgs.ContextMenuStrip プロパティの値が返されます。イベントハンドラない場合ContextMenuStrip プロパティの値を取得すると、以前指定された値、またはその既定値である null 参照 (Visual Basic では Nothing) が返されます。

大量データ処理する場合複数セルセルContextMenuStrip 値を設定する際のパフォーマンス低下回避するには、まず CellContextMenuStripNeeded イベントの処理が有効です。詳細については、「Windows フォーム DataGridView コントロール拡張するための推奨される手順」を参照してください

このプロパティ変更すると、(存在すれば) そのセル所有している DataGridView で CellContextMenuStripChanged イベント発生します

行の ContextMenuStrip プロパティ設定するか、DataGridView コントロールの RowContextMenuStripNeeded イベント処理して個別セルではなく個別の行にショートカット メニュー指定することもできますセルContextMenuStrip プロパティ設定は、行の ContextMenuStrip プロパティ設定オーバーライドし、CellContextMenuStripNeeded イベントは、RowContextMenuStripNeeded イベントと行の ContextMenuStrip プロパティ設定両方オーバーライドます。ただし、セルショートカット メニューnull 参照 (Visual Basic では Nothing) を指定すると、行のショートカット メニューオーバーライドされるの回避できます

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewCell クラス
DataGridViewCell メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridView.CellContextMenuStripChanged イベント
DataGridView.CellContextMenuStripNeeded イベント
DataGridView.DataSource プロパティ
DataGridView.VirtualMode プロパティ
DataGridView.RowContextMenuStripNeeded イベント
DataGridViewRow.ContextMenuStrip
GetInheritedContextMenuStrip
ContextMenuStrip クラス



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataGridViewCell.ContextMenuStrip プロパティ」の関連用語

DataGridViewCell.ContextMenuStrip プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridViewCell.ContextMenuStrip プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS