![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#6
|
||||
|
||||
|
Pues, la verdad es que he probado mil una veces esta parte de códgo que añado más abajo, y no entiendo porqué no me funciona.
Con el debuger veo que al intentar dar el valor 1 a SetLength, Delphi no lo ejecuta y me lo sigue dejando a 0. He probado con SelectAll y sí que me funciona, es decir, cada vez que pulso una tecla me borra todo el texto ya escrito previamente. No lo entiendo!!? Ayuda, por favor!!! Gracias procedure TMaster.FormKeyPress(Sender: TObject; var Key: Char); begin If Key = #13 Then Begin If HiWord(GetKeyState(VK_SHIFT)) <> 0 then SelectNext(Sender as TWinControl, False, True ) else SelectNext(Sender as TWinControl, True, True ); Key := #0; end; If Odd(GetKeyState(VK_INSERT)) Then With TDBEdit(Sender) Do If SelLength = 0 then Case Key of ' '..#126, #128..#255: begin SelLength := 1; If (SelLength > 0) and (SelText[1] = #13) then SelLength := 2; end; end; end; |
|
|
|