使用TntDbGrind 如何在改變那一行的顏色 |
缺席
|
weiliching
初階會員 發表:53 回覆:78 積分:31 註冊:2003-12-27 發送簡訊給我 |
我在 之前是使用 DbGrid 元件上,更改單行是沒有問題.
但是換成TntDbGrind 元件就會發生了[Error] M_Tran.pas(1564): Incompatible types: 'TTntColumn' and 'TColumn' 這種錯誤 程式碼下 procedure TM_TranF.TntDBGrid5DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin Tntdbgrid5.Canvas.Brush.Color := $00FFEBDF; TntDbGrid5.Canvas.Font.Color := clWindowText; Tntdbgrid5.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; 請大大協助找一下問題在何處.!! 感謝不盡. B,Rgds Vincent wei |
ko
資深會員 發表:28 回覆:785 積分:444 註冊:2002-08-14 發送簡訊給我 |
看起來是
Tntdbgrid5.DefaultDrawColumnCell(Rect, DataCol, Column, State); 有錯誤TNT元件的TColumn被宣告為TTntColumn 所以在DefaultDrawColumnCell的FUNCTION不能用TColumn 請改成宣告TTntColumn來做 ===================引 用 weiliching 文 章=================== 我在 之前是使用 DbGrid 元件上,更改單行是沒有問題. 但是換成TntDbGrind 元件就會發生了[Error] M_Tran.pas(1564): Incompatible types: 'TTntColumn' and 'TColumn' 這種錯誤 程式碼下 procedure TM_TranF.TntDBGrid5DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin Tntdbgrid5.Canvas.Brush.Color := $00FFEBDF; TntDbGrid5.Canvas.Font.Color := clWindowText; Tntdbgrid5.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; 請大大協助找一下問題在何處.!! 感謝不盡. B,Rgds Vincent wei
------
====================== 昏睡~ 不昏睡~ 不由昏睡~ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |