Ist bestimmt ganz einfach!
Ich denke nur zu kompliziert!
Ach hier die Einfärbung rot!
Delphi-Quellcode:
procedure TForm1.CRDBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
i : Integer;
Wert: string;
begin
if (CRDBGrid1.DataSource.DataSet.RecordCount = 0) then
Exit;
Wert := CRDBGrid1.DataSource.DataSet.FieldByName('Zuordnung').Value;
if Wert = 'ausgerückt' then begin
CRDBGrid1.Canvas.Brush.Color := clred;
CRDBGrid1.Canvas.Font.Color := clblack;
end else
if Wert = '0 Eingang' then begin
CRDBGrid1.Canvas.Brush.Color := clyellow;
CRDBGrid1.Canvas.Font.Color := clblack;
end else
if Wert = 'Bearbeitung' then begin
CRDBGrid1.Canvas.Brush.Color := clFuchsia;
CRDBGrid1.Canvas.Font.Color := clblack;
end else
if Wert = 'Vor Ort beendet' then begin
CRDBGrid1.Canvas.Brush.Color := cllime;
CRDBGrid1.Canvas.Font.Color := clblack;
end else begin
end;
CRDBGRid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
begin
CRDBGRid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
if (gdSelected in State) then
begin
// Form1.CRDBGrid1.Canvas.Brush.Color := clSilver;
// Form1.CRDBGrid1.Canvas.Font.Color:=clblack;
end;
form1.crDBGrid1.Canvas.FillRect(Rect);
form1.crDBGrid1.Canvas.TextOut(Rect.Left + 2, Rect.Top + 1, Column.Field.AsString);
begin
with MyTable1 do
for i := 5 to Pred(Fields.Count) do
Fields[i].DisplayWidth := 255;
end;
end;
end;
__________________________________________________ __________________________________________________ ___
Die Einsatznummer wird abgeholt, aus einem Memo!
Delphi-Quellcode:
procedure TForm1.AdvGlowButton28Click(Sender: TObject);
begin
DBEdit9.Text := Copy(DBMemo3.Text, Length(DBMemo3.Text)-9, 10);
end;