Programa calcula la superficie
Sigue la formula correspondiente para halla la superfiecie esta heco en .net
Public Class Calcular_Superficie
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'declarar todas las variables
Dim br#, h#, superficie#
'validar los objetos de entrada
If Me.obase.Text = "" Then
MsgBox("favor digite las bases")
Me.obase.Focus()
Else
If Me.oaltura.Text = "" Then
MsgBox("digite la altura")
Me.oaltura.Focus()
Else
'asignar los valores a las variables de entrada
br = Me.obase.Text
h = Me.oaltura.Text
'proceso
superficie = br * h
'asiganar la respuesta de salida
Me.Label5.Text = superficie
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.obase.Text = ""
Me.oaltura.Text = ""
Me.Label5.Text = ""
Me.obase.Focus()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If (MsgBox("¿nos vemos luego viejo?", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, "advertencia")) = MsgBoxResult.Ok Then
Me.Close()
End If
End Sub
End Class
Comentarios
Publicar un comentario