掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
stringgridでセルを比較して一致しなかったら色を付けるには? (ID:39246)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin if gdFixed in State then Exit; // 1 が A列 のセル // 2 が B列 のセル if StringGrid1.Cells[1, ARow] <> StringGrid1.Cells[2, ARow] then begin StringGrid1.Canvas.Brush.Color := clRed; StringGrid1.Canvas.FillRect(Rect); StringGrid1.Canvas.TextRect(Rect, Rect.Left+2, Rect.Top+2, StringGrid1.Cells[ACol, ARow]); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.