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

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

DataGridView.RowLeave イベント

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

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

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

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

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

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

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

Private Sub dataGridView1_RowEnter(ByVal
 sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles dataGridView1.RowEnter

    Dim i As Integer
    For i = 0 To dataGridView1.Rows(e.RowIndex).Cells.Count
 - 1
        dataGridView1(i, e.RowIndex).Style _
            .BackColor = Color.Yellow
    Next i

End Sub

Private Sub dataGridView1_RowLeave(ByVal
 sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles dataGridView1.RowLeave

    Dim i As Integer
    For i = 0 To dataGridView1.Rows(e.RowIndex).Cells.Count
 - 1
        dataGridView1(i, e.RowIndex).Style _
            .BackColor = Color.Empty
    Next i

End Sub
private void dataGridView1_RowEnter(object
 sender, 
    DataGridViewCellEventArgs e)
{
    for (int i = 0; i < dataGridView1.Rows[e.RowIndex].Cells.Count;
 i++)
    {
        dataGridView1[i, e.RowIndex].Style.BackColor = Color.Yellow;
    }
}

private void dataGridView1_RowLeave(object
 sender, 
    DataGridViewCellEventArgs e)
{
    for (int i = 0; i < dataGridView1.Rows[e.RowIndex].Cells.Count;
 i++)
    {
        dataGridView1[i, e.RowIndex].Style.BackColor = Color.Empty;
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS