Sera una tonteria si pero mi duda es esta lo necesito para un proyecto que tengo entre manos
lo unico que quiero es comparar entre 2 textbox, los 2 contienen numeros
y que depende de cual sea mas grande se accione una accion u otra.
ejemplo:
if text1.text es mas grande que text2.text then
End
else
Msgbox "TK <3"
end if
aver si alguien me puede ayudar saludos!
Lo estas preguntando seriamente?
Me quiero imaginar que no ...
Me quiero imaginar que no ...
si.. xDDD apenas programo en vb pero por necesidad lo tendre que hacer esta vezosnaraus escribió:Lo estas preguntando seriamente?
Me quiero imaginar que no ...
para eso no esta < , > ?
if text1.text > text2.text then
End
else
Msgbox "TK <3"
end if
no se si sera asi , no se vb pero no tiene mucho misterio
if text1.text > text2.text then
End
else
Msgbox "TK <3"
end if
no se si sera asi , no se vb pero no tiene mucho misterio
If Val(Text1.Text) < Val(Text2.Text) Then
MsgBox ("el mayor es text2")
ElseIf Val(Text1.Text) > Val(Text2.Text) Then
MsgBox ("el mayor es text1")
Else
MsgBox ("Son iguales")
End If
MsgBox ("el mayor es text2")
ElseIf Val(Text1.Text) > Val(Text2.Text) Then
MsgBox ("el mayor es text1")
Else
MsgBox ("Son iguales")
End If
word93 escribió:para eso no esta < , > ?
if text1.text > text2.text then
End
else
Msgbox "TK <3"
end if
no se si sera asi , no se vb pero no tiene mucho misterio
si, funciona a la perfeccion, muchas gracias
osnaraus escribió:If Val(Text1.Text) < Val(Text2.Text) Then
MsgBox ("el mayor es text2")
ElseIf Val(Text1.Text) > Val(Text2.Text) Then
MsgBox ("el mayor es text1")
Else
MsgBox ("Son iguales")
End If
gracias por la ayuda
no es necesario usar val() tambien podrias asi
Código: Seleccionar todo
If Text1.Text > Text2.Text Then
MsgBox "Es mayor el 1"
Else
MsgBox "Es mayor el 2"
End If
cierto yo tambien me fije pero bueno su aporte sigue siendo util|||L1v3H||| escribió:no es necesario usar val() tambien podrias asi
Código: Seleccionar todo
If Text1.Text > Text2.Text Then MsgBox "Es mayor el 1" Else MsgBox "Es mayor el 2" End If
Salu2
Yo no soy especialista en vb6, pero me parece que si no pones Val|||L1v3H||| escribió:no es necesario usar val()
te toma el caracter ASCII, por lo cual, te daría error al comparar por ejemplo: (23 < 5)
ya que compararía primero el primer caracter de cada uno.
Puestos a pedir, no estaría mal añadir que el texbox no admitiera letras, solo números.

http://img844.imageshack.us/img844/8088/mujerrara.jpg
http://img715.imageshack.us/img715/5813/tigree.png
http://img830.imageshack.us/img830/6484/camaleon.png
http://img839.imageshack.us/img839/4944/tigrev2.jpg
http://img843.imageshack.us/img843/443/spidermanxn.png
http://www.youtube.com/watch?v=wHYYkciIKE0