Cita:
Empezado por compuin
Aunque el ejemplo lo hace con todas las celdas
Yo necesito que las celdas de escabezado queden centradas y el resto alineadas a la derecha
|
Código Delphi
[-]
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
Alin: integer;
begin
with Sender as TStringGrid do
begin
if ARow = 0 then
Alin:= DT_CENTER
else
Alin:= DT_RIGHT;
InflateRect(Rect, -1, -1);
Canvas.FillRect(Rect);
InflateRect(Rect, -3, -3);
DrawText(Canvas.Handle, PAnsiChar(Cells[ACol, ARow]), Length(Cells[ACol, ARow]), Rect,
Alin or DT_VCENTER or DT_SINGLELINE);
end;
end;
Cita:
Empezado por compuin
Adicional, el color azul de la celda activa me gustaria quitarlo tambien
|
Saludos.