Hola aguml.
A mi tampoco se me ocurre otro medio mas sencillo que agregar un espacio al final. Pero si me permites, yo restructuraría el código de este modo:
Código:
void __fastcall TFormRanking::StringGridRankingDrawCell(TObject *Sender, int ACol,
int ARow, TRect &Rect, TGridDrawState State)
{
TStringGrid *SG = static_cast<TStringGrid*>((TStringGrid*)(Sender));
String cad = SG->Cells[ACol][ARow];
HDC dc = StringGrid1->Canvas->Handle;
register int Flags = (ACol == 1 ? DT_CENTER | DT_VCENTER | DT_SINGLELINE :
DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
cad += (ACol > 1 ? " " : "");
if (State.Contains(gdFixed)) {
SG->Canvas->Brush->Color = clBtnFace;
SG->Canvas->Font->Color = clWindowText;
SG->Canvas->FillRect(Rect);
DrawText(dc, cad.c_str(), cad.Length(), &Rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}
else if(State.Contains(gdSelected)) {
SG->Canvas->Brush->Color = clAqua;
SG->Canvas->Font->Color = clWindowText;
SG->Canvas->FillRect(Rect);
DrawText(dc, cad.c_str(), cad.Length(), &Rect, Flags);
}
else {
if (ARow % 2 == 0){
SG->Canvas->Brush->Color = clSilver;
SG->Canvas->Font->Color = clWindowText;
}
else {
SG->Canvas->Brush->Color = SG->Color;
SG->Canvas->Font->Color = SG->Font->Color;
}
SG->Canvas->FillRect(Rect);
DrawText(dc, cad.c_str(), cad.Length(), &Rect, Flags);
}
}
Saludos
![Smilie](http://www.clubdelphi.com/foros/images/smilies/smile.gif)