掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
DBGridで特定のセルの色を変更 (ID:39493)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
DBGridのOnDrawColumnCellイベントで procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if Column.Field.Value >500000 then begin DBGrid1.Canvas.Brush.Color := clGreen; //背景緑 DBGrid1.Canvas.Font.Color := clWhite; //文字白抜き end; if Column.Index=2 then //給与フィールドのindex番号を指定 DBGrid1.DefaultDrawColumnCell(Rect, Datacol, Column, State); end; こんな感じで出来ないですか?
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.