FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
#1
|
|||
|
|||
Suma de Edit
Buenas tarde mi consulta es la siguiente tengo 3 Edit, al ingresar un (valor en el Edit1 * valor en el Edit2)+70 = Edit3, osea que automaticamente me aparesca el resultado en el Edit3. Bueno lo intenté al compilar me da un error Project Project1.exe raised exception class EconvertError with Message''''is not a valide integer value., acepto los errores y me funciona bien pero no puedo sumarle el 70
|
#2
|
||||
|
||||
form create
te da ese error por que lo estas programando en el evento form create
__________________
un tipo al cual la sociedad no le tiene el mas mínimo respeto no puede ser presidente.... |
#3
|
||||
|
||||
Hola Olenkaguilar:
Para corregir tu problema te sugiero que en vez de utilizar un Edit como Edit1 uses un SpinEdit de la paleta samples ( si quieres lo puedes llamar Edit1 y así no necesitas modificar tu código) y le asignes como minvalue 1 y como maxvalue 32, que son tus opciones y que asignes tu código además al evento OnChange del SpinEdit. Para sumar 70 sólo debes incluir +70 en el valor del Edit2, de la siguiente manera:
Ojalá te haya podido ayudar Salu2 |
#4
|
||||
|
||||
Hola Olenkaguilar.
Lo que te sugiere radenf es muy buena opción, sobre todo por que te ahorras controlar los valores de un edit. Y para organizár y reducir el código podes hacer:
(*) Todo el código del evento OnCreate lo podes evitar configurando las propiedades en tiempo de diseño con el Object Inspector. Saludos
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#5
|
|||
|
|||
Hola de nuevo
Muchas a radenf y a ecfisa, lo que me indico randenf está bien, pero yo cometí un error en dar mi code, es por eso que me perdí al ver el code de ecfisa. vuelvo a colocar mi código:
Osea en algunos les estoy agregando 70 y en otros al 70 le estoy restando( por ejemplo en la opción 31 le estoy restando al 70 y en la opción 32 le estoy agregando 70) Ahora le eh puesto 2 radiobuttons. quisiera que al iniciar el programa siempre este seleccionado el radiobutton1 y que ejecute el código de arriba y si cambio al radiobutton2 ejecute este código( es lo mismo si no que cambia a lo que estado agregando 70, al 70 ahora le estan restando y viceversa):
|
#6
|
|||
|
|||
Me olvidaba
En un SpinEdit no puedo agregar manualmente los números, me sale error al parecer no puede estar vacío
|
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Armar Edit a partir de otros Edit | giulichajari | Varios | 5 | 13-03-2014 21:15:11 |
Suma en un Edit | lily21 | Varios | 7 | 11-01-2010 11:01:52 |
Suma StrToInt para Edit vacios | cocke | C++ Builder | 8 | 28-11-2006 09:19:40 |
problemas con el el .Edit: qryCONSULTA.Edit | McRose | Conexión con bases de datos | 3 | 07-06-2005 15:46:39 |
mostrar suma | alachaise | PHP | 1 | 14-04-2005 15:57:05 |
|