Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 23-02-2017
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.340
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Una primera aproximación dependiendo del comportamiento que necesites podría ser esta:

Código Delphi [-]
procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
var
  edt:TEdit;
  pos:integer;
begin
  edt := TEdit(Sender);
  // Tecla especiales
  if (key = VK_DELETE) or (key = VK_BACK) then
    exit;
  pos := edt.SelStart;
  if (Length(edt.Text)=2) or (Length(edt.Text)=5) then begin
    if edt.Text[Length(edt.Text) - 1] <> '-' then begin
      edt.Text := edt.Text + '-';
    end;
  end;
  edt.SelStart := pos + 1;
end;

En el evento OnKeyUp del TEdit.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
TJvDBCalcEdit y el . como separador decimal PacoPepe Conexión con bases de datos 3 15-11-2012 14:42:10
Separador de miles como separador decimal jmselesan OOP 4 12-06-2011 22:21:54
insertar n registros en una tabla automaticamente zcatzz SQL 2 08-02-2007 03:42:04
Como setear el separador decimal y el separador de miles en WIN98 robertoe API de Windows 3 26-11-2006 17:12:02
Separador decimal como coma (,) Investment SQL 2 26-01-2004 11:36:10


La franja horaria es GMT +2. Ahora son las 15:37:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi