DataGridView.CellLeave イベントとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridView.CellLeave イベントの意味・解説 

DataGridView.CellLeave イベント

メモ : このイベントは、.NET Framework version 2.0新しく追加されたものです。

セル入力フォーカス失い現在のセルではなくなった場合発生します

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

Public Event CellLeave As
 DataGridViewCellEventHandler
Dim instance As DataGridView
Dim handler As DataGridViewCellEventHandler

AddHandler instance.CellLeave, handler
public event DataGridViewCellEventHandler CellLeave
public:
event DataGridViewCellEventHandler^ CellLeave {
    void add (DataGridViewCellEventHandler^ value);
    void remove (DataGridViewCellEventHandler^ value);
}
/** @event */
public void add_CellLeave (DataGridViewCellEventHandler
 value)

/** @event */
public void remove_CellLeave (DataGridViewCellEventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例

このイベント処理して現在のセルの SelectionBackColor プロパティ変更する方法次のコード例示します。この例では、背景色選択は CellEnter イベント設定されCellLeave イベントEmptyリセットされます。この例を実行するには、dataGridView1 という名前の DataGridView が配置されているフォームコード貼り付けすべてのイベント確実にイベント ハンドラ関連付けます。

Private Sub dataGridView1_CellEnter(ByVal
 sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles dataGridView1.CellEnter

    dataGridView1(e.ColumnIndex, e.RowIndex).Style _
        .SelectionBackColor = Color.Blue

End Sub

Private Sub dataGridView1_CellLeave(ByVal
 sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles dataGridView1.CellLeave

    dataGridView1(e.ColumnIndex, e.RowIndex).Style _
        .SelectionBackColor = Color.Empty

End Sub
private void dataGridView1_CellEnter(object
 sender, 
    DataGridViewCellEventArgs e)
{
    dataGridView1[e.ColumnIndex, e.RowIndex].Style
        .SelectionBackColor = Color.Blue;
}

private void dataGridView1_CellLeave(object
 sender, 
    DataGridViewCellEventArgs e)
{
    dataGridView1[e.ColumnIndex, e.RowIndex].Style
        .SelectionBackColor = Color.Empty;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataGridView.CellLeave イベントを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataGridView.CellLeave イベントを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataGridView.CellLeave イベント を検索

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

辞書ショートカット

すべての辞書の索引

「DataGridView.CellLeave イベント」の関連用語

DataGridView.CellLeave イベントのお隣キーワード
検索ランキング

   

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



DataGridView.CellLeave イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS