Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Tpercon,
25. Aug 2003
Ersetze das obige DrawText mal durch das hier:
DrawText(StringGrid1.Canvas.Handle, PChar(s), Length(s), Rect, DT_SINGLELINE or DT_CENTER or DT_VCENTER);
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Tpercon,
25. Aug 2003
Da wirst du wohl kaum um das OnDrawCell Ereignis herum kommen.
Hier mal nen Beispiel auf die Schnelle:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var s: string;
begin
s := StringGrid1.Cells;
StringGrid1.Canvas.FillRect(Rect);
DrawText(StringGrid1.Canvas.Handle, PChar(s), Length(s), Rect, DT_Center);