Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

ayuda con un textbox

Estas en el tema de ayuda con un textbox en el foro de Visual Basic clásico en Foros del Web. Amigos del foro Alguien me podria dar el codigo para poder mostrar automaticamente en un textbox la suma total de varios texbox, esto es en ...
  #1 (permalink)  
Antiguo 31/10/2007, 16:27
Avatar de juancho24  
Fecha de Ingreso: octubre-2007
Mensajes: 101
Antigüedad: 16 años, 6 meses
Puntos: 1
Pregunta ayuda con un textbox

Amigos del foro

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
  #2 (permalink)  
Antiguo 31/10/2007, 18:48
 
Fecha de Ingreso: marzo-2005
Ubicación: Sevilla
Mensajes: 277
Antigüedad: 19 años, 1 mes
Puntos: 2
Re: ayuda con un textbox

text1.text= val(text2.text) + val(text3.text) + ...
  #3 (permalink)  
Antiguo 31/10/2007, 18:59
Avatar de juancho24  
Fecha de Ingreso: octubre-2007
Mensajes: 101
Antigüedad: 16 años, 6 meses
Puntos: 1
Pregunta Re: ayuda con un textbox

Cita:
Iniciado por Manu_Leon Ver Mensaje
text1.text= val(text2.text) + val(text3.text) + ...

mira tengo ese codigo, lo que pasa es k quiero k me muestre automaticamente el resultado en este textbox, y no me funciona, solo al momento de hacer clic en el textbox me aparece,sera que no estoy usando bien el evento click ¿sera otro evento?

ayudenmeee porfavor

gracias

saludos

Private Sub txtActivosProductivos_Click()

txtActivosProductivos.Text = Val(txtValorAutomoviles.Text) + Val(txtValorMaquinarias.Text) + Val(txtValorMobiliario.Text) + Val(txtValorOtros.Text)

End Sub
  #4 (permalink)  
Antiguo 01/11/2007, 01:38
 
Fecha de Ingreso: abril-2007
Mensajes: 187
Antigüedad: 17 años
Puntos: 1
Re: ayuda con un textbox

Si las cantidades no son excesivamente grandes puedes hacerlo así:

Código:
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
Si son números muy grandes usa variables, ok.

Saludos.
  #5 (permalink)  
Antiguo 01/11/2007, 12:15
Avatar de juancho24  
Fecha de Ingreso: octubre-2007
Mensajes: 101
Antigüedad: 16 años, 6 meses
Puntos: 1
De acuerdo Re: ayuda con un textbox

Cita:
Iniciado por ReViJa Ver Mensaje
Si las cantidades no son excesivamente grandes puedes hacerlo así:

Código:
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
Si son números muy grandes usa variables, ok.

Saludos.

Problema solucionado, muchas gracias por la ayuda

Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:14.