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

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

← →
Ricko ©   (2005-07-12 11:57) [0]

Почему не срабатывает событие OnDrawDataCell, в не зависимости от значения свойства DefaultDrawing?

Код следующий :

procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
 Field: TField; State: TGridDrawState);
begin
    If gdFocused in State then
       with (Sender as TDBGrid).Canvas do
       begin
         Brush.Color := clRed;
         FillRect(Rect);
         TextOut(Rect.Left, Rect.Top, Field.AsString);
       end;
end;


или такой:

procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
 Field: TField; State: TGridDrawState);
begin
if Query.FieldByName("Size").AsFloat > 10 then
   DBGrid1.Canvas.Font.Color := clRed;
 DBGrid1.DefaultDrawDataCell(Rect, Field, State);
end;


← →
sniknik ©   (2005-07-12 12:02) [1]

вопрос не соответствует теме. фактически вопрос является оффтопиком.



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

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



Память: 0.45 MB
Время: 0.024 c
3-1121238833
_Anton
2005-07-13 11:13
2005.08.21
BDE Oracle Blob


4-1120138852
<Lelik>
2005-06-30 17:40
2005.08.21
Про CB_DIR


1-1122562814
Selen
2005-07-28 19:00
2005.08.21
Help!!! Edit i расширение


8-1113616597
Ivanov
2005-04-16 05:56
2005.08.21
Image из .pak - файла


8-1113335006
Fedor
2005-04-12 23:43
2005.08.21
И снова DSPack




   Наверх