掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
DBGrid内でCheckBoxと文字色変更 (ID:32931)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
>>igyさま すみません、標準ではないです… ソースは↓です。 procedure TFRDBGrid.DrawColumnCell(const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var X, Y: Integer; begin if (0 < Column.PickList.Count) and (Column.PickList[0] = 'CHECKBOX') and (Column.ButtonStyle = cbsNone) and not (Column.Field.DataSet.Bof and Column.Field.DataSet.Eof) then begin // チェックボックスを描画 X := (Rect.Left + Rect.Right) div 2 - 6; Y := (Rect.Top + Rect.Bottom) div 2 - 6; with Canvas do begin FillRect(Rect); Pen.Color := Canvas.Font.Color; Rectangle(X, Y, X + 11, Y + 11); if (Column.Field.AsString <> '') and (Column.Field.AsString <> 'F') then begin MoveTo(X + 2, Y + 4); LineTo(X + 2, Y + 7); MoveTo(X + 3, Y + 5); LineTo(X + 3, Y + 8); MoveTo(X + 4, Y + 6); LineTo(X + 4, Y + 9); MoveTo(X + 5, Y + 5); LineTo(X + 5, Y + 8); MoveTo(X + 6, Y + 4); LineTo(X + 6, Y + 7); MoveTo(X + 7, Y + 3); LineTo(X + 7, Y + 6); MoveTo(X + 8, Y + 2); LineTo(X + 8, Y + 5); end; end; end else begin // 標準のテキストを描画 DefaultDrawColumnCell(Rect, DataCol, Column, State); end; end; これがCHECKBOXを描写しているソースです。 よろしくお願いいたします。
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.