Форум: "Базы";
Текущий архив: 2002.02.18;
Скачать: [xml.tar.bz2];
ВнизКак в RXDBGrid текущию строку сделать с другим Font или цветом? Найти похожие ветки
← →
savva (2002-01-24 10:47) [5]Delphi Help ©
The following example conditionally changes the font color of rows in a DB Grid. The following code is added to the DB Grid’s OnDrawDataCell event. If the field Size is greater than 10, the row’s font will be red.
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);
begin
if Table1.FieldByName("Size").AsFloat > 10 then
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);
end;
надо привязываться к State:
Description
TGridDrawState represents state information about the cell of a grid that is being rendered. It is a set that includes 0 or more of the following:
Value Meaning
gdSelected The cell is currently selected.
gdFocused The cell has input focus.
gdFixed The cell is in the fixed region of the grid.
то есть тебе надо gdFocused - и все...
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2002.02.18;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.004 c