掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
DataGridViewのチェックボックスについて (ID:146592)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
あ さん 解決しました。 ありがとうございました。 解決コードは下記です。 CellValueChangedイベント '★☆★☆★ チェックボックス件数 ★☆★☆★ If DataGridView_Tab1.RowCount = 0 Then Exit Sub End If If Cnt_Flg = True Then Exit Sub If DataGridView_Tab1(0, e.RowIndex).Value = 1 Then Chk_Count += 1 DataGridView_Tab1("品番ID", e.RowIndex).Style.BackColor = Color.Orange Else If Cnt_Flg2 = False OrElse Chk_Row <> e.RowIndex Then Chk_Count -= 1 If e.RowIndex Mod 2 = 0 Then DataGridView_Tab1("品番ID", e.RowIndex).Style.BackColor = Color.White Else DataGridView_Tab1("品番ID", e.RowIndex).Style.BackColor = G_ARGB End If End If End If If Chk_Count > 10 Then Cnt_Flg = True MessageBox.Show("11件以上はチェックできません", My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error) DataGridView_Tab1(0, e.RowIndex).Value = 0 Chk_Count -= 1 If e.RowIndex Mod 2 = 0 Then DataGridView_Tab1("品番ID", e.RowIndex).Style.BackColor = Color.White Else DataGridView_Tab1("品番ID", e.RowIndex).Style.BackColor = G_ARGB End If Cnt_Flg = False Cnt_Flg2 = True Chk_Row = e.RowIndex Exit Sub End If Cnt_Flg2 = False Chk_Row = 0
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.