SoloCodigo

Programación General => Visual Basic 6.0 e inferiores => VBA => Mensaje iniciado por: arielb en Jueves 14 de Octubre de 2004, 19:22

Título: Blokear Text Box
Publicado por: arielb en Jueves 14 de Octubre de 2004, 19:22
k tal amigos tengo un text box que guarda un resultado de la resta de otro ejm
Text1= (text2.value - text3.value) +1

lo que necesito hacer es k el text1 no permita k el valor k obtenga de esa operación se pueda modificar,
gracias de antemano, saludos
Título: Re: Blokear Text Box
Publicado por: RadicalEd en Jueves 14 de Octubre de 2004, 19:50
A VER PRIMERO QUE TODO NO EXISTE Text2.Value NI Text3.Value
TIENES QUE PONERLO ASI
Text1.Text=(Val(Text2.Text)-Val(Text3.Text))+1
EL Val REEMPLAZA EL TAL.Value AL FINAL COLOCAS
Text1.Enabled=False
O PARA QUE TE QUEDE MAS BONITO SIN EL GRIS DE FONDO

Código: Text
  1.  
  2. Private Sub Text1_KeyPress(KeyAscii As Integer)
  3. KeyAscii = 0
  4. End Sub
  5.