Ver Mensaje Individual
  #2  
Antiguo 03-05-2006
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

A ver si algo así te da una idea por lo menos:

Código Delphi [-]
(*

  Se asume que en un formulario (Form1) hay un "TMemo"
  (Memo1) y un "TLabel" (Label1).

*)

procedure TForm1.FormCreate(Sender: TObject);
begin
  Memo1.MaxLength := 200;
  Label1.Caption := 'Escritos: 0 caracteres / Disponibles: 200 caracteres';
end;

procedure TForm1.Memo1Change(Sender: TObject);
resourcestring
  rsInformacion = 'Escritos: %d caracteres / Disponibles: %d caracteres';
var
  totalCaracteresEscritos,
  totalCaracteresDisponibles: integer;
begin
  totalCaracteresEscritos := Length(Memo1.Text);
  totalCaracteresDisponibles := Memo1.MaxLength - totalCaracteresEscritos;
  Label1.Caption := Format(rsInformacion, [totalCaracteresEscritos, totalCaracteresDisponibles]);
end;
__________________
David Esperalta
www.decsoftutils.com

Última edición por dec fecha: 03-05-2006 a las 18:13:45.
Responder Con Cita