Ver Mensaje Individual
  #2  
Antiguo 22-09-2004
Avatar de yusnerqui
yusnerqui yusnerqui is offline
Miembro
 
Registrado: mar 2004
Ubicación: Cuba
Posts: 679
Reputación: 23
yusnerqui Va por buen camino
Primero que nada quiero pedirte disculpa por mi falta de conocimiento (No se que es una aplicación CLX ), pero quizás el truco 234 de Trucomanía te pueda ayudar, a continuación te lo cito.

Cita:
Empezado por Trucomanía
Pon este código en el evento OnDrawCell de tu StringGrid:

Código Delphi [-]
procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Integer;
  Rect: TRect; State: TGridDrawState);
var sCad:String;
    i:integer;
    bEsNum:Bool;
begin 
  if StringGrid1.Cells[Col,Row] <> '' then 
  begin 
     bEsNum := True;
     sCad := StringGrid1.Cells[Col,Row];
     for i:=1 to length(sCad) do 
         if not (sCad[i] in ['0'..'9','-']) then bEsNum := False;
     if bEsNum then 
     begin 
        {'%15 para una longitud maxima de 15 caracteres}
        {'%15 for a Max Length of 15 characteres}
        sCad := Format('%15.0n',[StrToFloat(StringGrid1.Cells[Col,Row])]);
        with StringGrid1 do 
          with Canvas,Rect do 
          begin 
             i:=Right-TextWidth(sCad+' ');
             Canvas.FillRect(Rect);
             Canvas.TextOut(i,Top+2,sCad);
          end; 
     end; 
  end; 
end;
Espero que eso te pueda ayudar.

Un saludo

__________________
Lo importante no es llegar primero, sino saber llegar.

Para que puedas llegar mejor lee la Guia de Estilo

Responder Con Cita