Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.03.17;
Скачать: CL | DM;

Вниз

выделение записей цветом простом DBGRID е или DBGRIDEH е   Найти похожие ветки 

 
Stas ©   (2003-02-24 16:44) [0]

Если кто знает как выделить запись цветом в простом Dbgride или в Dbgrideh, подскажите пожалуйста.


 
Леший_   (2003-02-24 17:05) [1]

Это небольшой фрагмет в виде примерчика...

procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var Im1: TBitmap;
begin
with DBGrid1.Canvas do
begin
if (Column.Field.FieldName = "......") and
not (gdSelected in State) then
if strtofloat(Column.Field.Text)=1 then
begin
Brush.Color:=clRED;
Font.Color:=clWHite;
FillRect(Rect);
TextOut(Rect.Left+2,Rect.Top+2,FormatFloat("### ### ###.##",StrToFloat(Column.Field.Text)));
exit;
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State)
end;


 
ermserg ©   (2003-02-24 19:10) [2]

to Leshiy:
Eto ne pravilno i chrevato kuchey Exceptions ( strtofloat(Column.Field.Text) ). Zachem risovat na Canvase esli dostatochno izmenit Font i Brush kak tebe nuzhno i vizvat DefaultDrawColumnCell.
to Stas. Ya 90% uveren, chto etot vopros est v FAQ"e.


 
AM ©   (2003-02-24 19:19) [3]

На королевстве Delphi был?

http://www.delphikingdom.com/helloworld/dbgridcolor.htm


 
ava ©   (2003-02-24 22:53) [4]

procedure TForm1.DBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
If ( условие ) then With DBGrid2.Canvas do
Begin

FillRect(Rect);
Font.Color := clRed;
TextOut (Rect.left+1, Rect.Top+2, Column.Field.Text)

end else

DBGrid2.DefaultDrawColumnCell (Rect,DataCol,Column,State)
end;



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

Текущий архив: 2003.03.17;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.013 c
14-54252
Пубертанец
2003-02-28 11:59
2003.03.17
Как сделать программу-резидент


14-54212
visor123
2003-03-03 12:00
2003.03.17
Как скачать обновление Delphi 6 ???


1-54017
axs
2003-03-06 18:44
2003.03.17
А это что за глюк???


14-54201
Дмитрий К.К.
2003-03-03 05:43
2003.03.17
Именинники 3 марта


7-54338
Slap
2003-01-17 11:48
2003.03.17
Проблема с CreateProcess в под Win9x