![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|
|
#1
|
|||
|
|||
|
Saludos.
Empezando con todos tus problemas. -Define primero que botón quieres que funcione con ENTER, cuando lo hagas cambia la propiedad DEFAULT a true (Todos en un mismo formulario no deberían de funcionar con enter). Te recomiendo unas busquedas en el foro hay respuestas individuales a tus inquietudes. Continuamos luego... Última edición por kman fecha: 18-08-2006 a las 20:02:13. |
|
#2
|
|||
|
|||
|
Realiza una condición para controlar el error de cálculo con edit en blanco, por ejemplo
Última edición por kman fecha: 18-08-2006 a las 23:01:02. |
|
#3
|
|||
|
|||
|
En tu código, pon al final un edit.setfocus para que al finalizar el foco se coloque en el edit que deseas.
|
|
#4
|
|||
|
|||
|
gracias...
y para que solo pueda poner numeros en los edit? |
|
#5
|
||||
|
||||
|
Cita:
Saludos
__________________
Van Troi De León (Not) Guía, Code vB:=Delphi-SQL, ¿Cómo? Viajar en el tiempo no es teóricamente posible, pues si lo fuera, ya estarían aqui contándonos al respecto! |
|
#6
|
||||
|
||||
|
Un TEdit limitado para entrar números Enteros
Código:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
var sNumAnterior:string;
begin
sNumAnterior := (sender as TEdit).Text;
if (key <> #3) and (key <> #22) then // #3 = Copiar (Ctrl + C)
begin // #22 = Pegar (Ctrl + V)
if key = '-' then
begin
if ((pos(key,(sender as TEdit).Text) > 0) and
(pos(key,(sender as TEdit).SelText) = 0))
or
((sender as TEdit).SelStart > 0)
then key:=#0;
end
else if not (key in ['0'..'9',#8]) then key:=#0;
end;
if key = #22 then
try
key := #0;
(sender as TEdit).PasteFromClipBoard;
StrToInt((sender as TEdit).Text);
except
(sender as TEdit).Text := sNumAnterior;
(sender as TEdit).SelStart := Length((sender as TEdit).Text);
end;
end;
Un TEdit limitado para entrar números Reales Código:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
var sNumAnterior:string;
begin
sNumAnterior := (sender as TEdit).Text;
if (key <> #3) and (key <> #22) then // #3 = Copiar (Ctrl + C)
begin // #22 = Pegar (Ctrl + V)
if key in ['-','.'] then
begin
if (pos(key,(sender as TEdit).Text) > 0) and
(pos(key,(sender as TEdit).SelText) = 0)
then key:=#0;
case key of
'-': if ((sender as TEdit).SelStart > 0) then key:=#0;
'.': if ((sender as TEdit).SelStart = 0) or
(((sender as TEdit).SelStart = 1) and
((sender as TEdit).Text[1] = '-'))
then key:=#0;
end;
end
else if not (key in ['0'..'9',#8]) then key:=#0;
end;
if key = #22 then
try
key := #0;
(sender as TEdit).PasteFromClipBoard;
StrToFloat((sender as TEdit).Text);
except
(sender as TEdit).Text := sNumAnterior;
(sender as TEdit).SelStart := Length((sender as TEdit).Text);
end;
end;
[email protected] |
|
#7
|
|||
|
|||
|
Cita:
|
|
#8
|
|||
|
|||
|
el segundo codigo incluye numeros como 0.5 ?
Cita:
|
|
#9
|
|||
|
|||
|
busqueda
Cita:
![]() ![]() |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| BUtton | yoko | Varios | 1 | 30-06-2006 04:28:05 |
| Button en DBgrid | Iskariote0087 | Varios | 2 | 15-05-2006 13:06:13 |
| Descargar icono de un Button | Iskariote0087 | Varios | 2 | 10-01-2006 12:04:36 |
| añadir a TQuickReport un button | jmlifi | Impresión | 2 | 11-10-2005 15:22:37 |
| colores a un Button | dmagui | OOP | 3 | 27-06-2005 19:51:44 |
|