sentencia if (respuesta)
mira este ejemplo esta hecho en visual 6.0 es de nivel inicial .
1 lo primero:
agrega 2 caja de texto :txt1,txt2
agrega 2 lable :label1,lable2
agrega 2 botones(cmdcalcular,cmdlimpiar)
agrega un cmdlimpiar
me.txt1.text=""
me.txtx2.text=""
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim n1 As Single
Dim n2 As Single
n1 = Val(Me.txt1.Text)
n2 = Val(Me.txt2.Text)
If n1 > n2 Then
Me.txtrespuesta.Text = "n1 es mayor y n2 es menor"
Else
Me.txtrespuesta.Text = "n2 es mayor y n1 es menor"
End If
End Sub
DIME SI QUIERES ASI O MAS COMPLICADO EN QUE NIVEL ESTAS.
|