Вниз
Скачать: 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.029 c
14-1122814320
Alexander Panov
2005-07-31 16:52
2005.08.21
просмотр форумов с кпк


14-1122466533
Lexer
2005-07-27 16:15
2005.08.21
Кляп удаленному компьютеру


14-1122579500
syte_ser78
2005-07-28 23:38
2005.08.21
Вау! Что я откопал!


14-1122063364
Vlad Oshin
2005-07-23 00:16
2005.08.21
Задача по физике.


9-1114777401
Chevrt
2005-04-29 16:23
2005.08.21
Повороот сцены




   Наверх