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

Изменить цвет текста   Найти похожие ветки 

← →
Leny ©   (2002-07-18 07:53) [0]

Подскажите, что здесь не так, почему не работает?
Я меняю цвет в ячейке:
StringGrid.Cells[0,0].Font.Color:=clRed;


← →
Opuhshii   (2002-07-18 08:06) [1]

какой странный у вас StringGrid,... Cells - массив строк,.. если конечно у Вас StringGrid - это TStringGrid,... и цвет в ячейке меняют OnDrawCell


← →
MBo ©   (2002-07-18 08:06) [2]

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if Acol=2 then
with StringGrid1,Canvas do begin
Font.Color:=clRed;
TextOut(Rect.Left+2,Rect.Top+2,Cells[Acol,ARow]);
end;
end;


← →
Explorer ©   (2002-07-18 08:11) [3]

Я со String не работал, а в DBGrid делаю так:

DBGridCells.{Columns[0]}Canvas.Font.Color:=clGreen;

Попробуй так!


← →
Leny ©   (2002-07-18 09:29) [4]

Почему при повторном выделении ячейки(где цвет текста был изменен) цвет опять становится черным?


← →
Explorer ©   (2002-07-18 10:07) [5]

Попробуй так:

procedure TFormFormDogovorss.GridActiveDogovorsDrawColumnCell(
Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin

if(QueryActiveDogovors.FieldByName("OnDatePaid").AsDateTime) =date() then begin
GridActiveDogovors.{Columns[0]}Canvas.Font.Color:=clBlue;
end;

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




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

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



Память: 0.46 MB
Время: 0.011 c
14-95528
fore_3
2002-06-29 01:21
2002.07.29
Люди, может лучше пользоваться поиском?


1-95402
sdram
2002-07-16 11:19
2002.07.29
DBGrid


7-95573
Dyacha
2002-05-08 12:03
2002.07.29
Как печатать книжки


1-95425
Makuha
2002-07-13 12:57
2002.07.29
TreeView - Help


6-95471
aaZ
2002-05-19 23:33
2002.07.29
ServerSocket




   Наверх