pro pme
Tak jsem dal na Vaše rady.
Stahnul a nainstaloval Delphi 7
Vytvořil novy projekt a do něj dal jen.
Vyzkoušel jsem i toto http://stackoverflow.com/questions/4720255/ondrawc ell-center-text-stringgrid-delphi
procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.Cells[1,1]:='10';
StringGrid1.Cells[1,2]:='20';
StringGrid1.Cells[1,3]:='10';
StringGrid1.Cells[1,4]:='20';
StringGrid1.Cells[1,5]:='10';
StringGrid1.Cells[1,6]:='20';
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
TW, TL:Integer;
begin
if ACol = 1 then
begin
TW := StringGrid1.Canvas.TextWidth(StringGrid1.Cells[ACo l, ARow]);
StringGrid1.Canvas.FillRect(Rect);
TL := Rect.Right - TW - 4;
StringGrid1.Canvas.TextOut(TL, Rect.Top + 4, StringGrid1.Cells[ACol, ARow]);
end;
end;
Vše nadherně funguje.
Pokud to uložím a pak otevřu v XE2 tak je to posmolene.
http://www.fastimages.eu/images/eeeeejuj.jpg