全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1787
推到 Plurk!
推到 Facebook!

使用TntDbGrind 如何在改變那一行的顏色

缺席
weiliching
初階會員


發表:53
回覆:78
積分:31
註冊:2003-12-27

發送簡訊給我
#1 引用回覆 回覆 發表時間:2008-06-25 11:36:24 IP:203.162.xxx.xxx 訂閱
我在 之前是使用 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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2008-06-25 12:59:41 IP:61.66.xxx.xxx 訂閱
 看起來是
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
------
======================
昏睡~
不昏睡~
不由昏睡~
系統時間:2024-03-28 17:38:03
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!