Videos

.

martes, 12 de mayo de 2009

Formula General en VB6 - Programación

Agregamos 3 cajas de texto(TextBox) y dos Label y un boton ya agregamos el siguiente codigo

Private Sub Command1_Click()
Dim a, b, c As Integer
Dim radicando As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
radicando = (b * b) - (4 * a * c)
If radicando < 0 Then
MsgBox "Error matematico"
Else
Label1.caption = ((-b) + Sqr(radicando)) / (2 * a)
Label2.caption = ((-b) - Sqr(radicando)) / (2 * a)
End If
End Sub

1 comentarios:

que buenooo¡¡ me salvaste de un 0 gracias¡¡¡

Insertar

Twitter Delicious Facebook Digg Stumbleupon Favorites More