我把一個數據集的數據分別放入兩個dbgrid中,我想實現在兩個dbgrid中當前資料背景色突出表示是當前筆資料。
解决方案 »
- 编写SQL动态查询报错
- 这个窗体加载为何是错误的?
- 请问怎么检索当前系统所有运行着的程序,然后根据标题内容选择性的关闭程序?
- DBGrid如何显示人民币符号
- 唧唧唧------三层开发的问题,使用多线程,很简单的例子,怎么不行啊?
- 用qreport报表怎么把当前dataset中的记录全部打印,而不是只打印当前记录
- 如何在installshield pro6.22中打包BDE
- 各位大哥帮帮我,为什么程序每次运行时读sql server库总提示用户名及密码,跳过此项怎么做?急!!!!!!!!!!!!!!!!!!!!
- 急需答案
- 我是delphi初学者,请教一个关于数据库的问题,希望不吝赐教.
- 如何定义一类控件???
- 一个很急的问题??在线等你!
{expose private & protected properties & methods}
TFriendly = class(TCustomDBGrid);procedure TFormSetting.DBGrid13DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
with TFriendly(Sender) do
begin
{Get active record within grids TDataLink. The active record will be
the current record in the dataset. Check against Row that we are
trying to Draw, -1 to offset the column headings within grid.}
if TDataLink(DataLink).ActiveRecord = Row - 1 then
begin
with Canvas do
begin
{set grids canvas to win highlight colour}
Brush.Color := $00C0FFFF; //clHighlight;
Font.Color := clBlack;
{now redraw the cell, but highlighted}
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
end;
end;