掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
DBGridの背景色に一行置きに色をつけるには? (ID:28699)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
DBGridExソースです unit DBGridEx; interface uses Windows, Classes, Messages, Grids, DBGrids; type TMouseDown2Event = procedure(Sender:TObject;Row,Col:Integer) of Object; TInplaceEdit2 = class(TInplaceEdit) private published property Font; end; TDBGridEx = class(TDBGrid) private FSaveRow : Integer; FSaveCol : Integer; FMouseDown2Event : TMouseDown2Event; public procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);override; procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; published property SaveRow : Integer read FSaveRow; property SaveCol : Integer read FSaveCol; property InplaceEditor; property Row; property Col; property OnMouseDown2 : TMouseDown2Event read FMouseDown2Event write FMouseDown2Event; end; procedure Register; implementation procedure TDBGridEx.DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); begin FSaveRow := ARow; FSaveCol := ACol; inherited; end; procedure TDBGridEx.WMLButtonDown(var Message: TWMLButtonDown); begin inherited; if Assigned(InplaceEditor) = True then begin if Assigned(FMouseDown2Event) = True then OnMouseDown2(Self,Row,Col); end; Exit; end; procedure Register; begin RegisterComponents('KHE00221 - DB', [TDBGridEx]); end; end.
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.