Вниз
Скачать: CL | DM;

DBGrid   Найти похожие ветки 

← →
Yank   (2001-12-16 18:41) [0]

Привет всем!!! подскажите как выделить цветом опреденную ячейку в DBGrid. Заранее благадарен...


← →
Turalyon ©   (2001-12-17 09:43) [1]

Почитай статью. Там есть все что тебе надо.
http://www.delphikingdom.com/helloworld/dbgridcolor.htm


← →
DmitryA ©   (2001-12-17 15:43) [2]

Все очень просто. Создайте свою обработку события DrawColumnCell, и впишите туда:

procedure TForm.PresDBGridDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
var voBrushColor: TColor;
begin
if gdFocused in State then exit;

voBrushColor := DBGrid.Canvas.Brush.Color;

if (Column.Field = TableField) then // отследить нужную колонку
if (TableFirls.AsFloat > 0) then // отследить нужное значение
DBGrid.Canvas.Brush.Color := clAqua; // или другой цвет по выбору

DBGrid.DefaultDrawColumnCell(Rect, DataCol, Column, State);
DBGrid.Canvas.Brush.Color := voBrushColor;
end;




Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.004 c
6-66334
Lamok
2001-10-24 17:09
2002.01.21
Tcp/ip


4-66391
Floyn
2001-11-20 10:00
2002.01.21
Как в DLL создать окно?


3-66199
Grey
2001-12-12 18:43
2002.01.21
Interbase и потоки


1-66284
StelZ
2002-01-04 00:44
2002.01.21
Всегда наверху


6-66333
Talgat
2001-10-21 21:58
2002.01.21
SMPP(Short Message Peer to Peer)




   Наверх