Alguien me podria dar el codigo para poder mostrar automaticamente en un textbox la suma total de varios texbox, esto es en visual basic 6
Gracias por la ayuda
saludos

| |||
Re: ayuda con un textbox Si las cantidades no son excesivamente grandes puedes hacerlo así:
Código:
Si son números muy grandes usa variables, ok.Private Sub Sumar() txtActivosProductivos.Text = Val(txtValorAutomoviles.Text) + Val(txtValorMaquinarias.Text) + Val(txtValorMobiliario.Text) + Val(txtValorOtros.Text) End Sub Private Sub txtValorAutomoviles_Change() Call Sumar End Sub Private Sub txtValorMaquinarias_Change() Call Sumar End Sub Private Sub txtValorMobiliario_Change() Call Sumar End Sub Private Sub txtValorOtros_Change() Call Sumar End Sub Saludos.
__________________ Aprende a programar desde cero !!! |
| ||||
![]() Cita:
Iniciado por ReViJa ![]() Si las cantidades no son excesivamente grandes puedes hacerlo así:
Código:
Si son números muy grandes usa variables, ok.Private Sub Sumar() txtActivosProductivos.Text = Val(txtValorAutomoviles.Text) + Val(txtValorMaquinarias.Text) + Val(txtValorMobiliario.Text) + Val(txtValorOtros.Text) End Sub Private Sub txtValorAutomoviles_Change() Call Sumar End Sub Private Sub txtValorMaquinarias_Change() Call Sumar End Sub Private Sub txtValorMobiliario_Change() Call Sumar End Sub Private Sub txtValorOtros_Change() Call Sumar End Sub Saludos. Problema solucionado, muchas gracias por la ayuda ![]() Saludos ![]() |