Codigo vb

Páginas: 2 (291 palabras) Publicado: 25 de marzo de 2011
Class Calculadora
Dim contenedor As Single
Dim funcion As String
btnsuma_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsuma.Click
IfTxtprincipal.Text = "" Then
MsgBox("No ha ingresado ningun dato", MsgBoxStyle.Critical, "error")
Else
contenedor = contenedor + Txtprincipal.Text
funcion = "suma"Txtprincipal.Text = ""

Private Sub Btnborrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnborrar.Click
contenedor = 0
funcion = ""Txtprincipal.Text = ""

Private Sub Btncalcular_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btncalcular.Click

If Txtprincipal.Text = "" ThenMsgBox("No ha ingresado ningun dato", MsgBoxStyle.Critical, "error")

ElseIf funcion = "suma" Then
Txtprincipal.Text = contenedor + Txtprincipal.Text

ElseIffuncion = "resta" Then
Txtprincipal.Text = contenedor - Txtprincipal.Text
ElseIf funcion = "multiplicar" Then
Txtprincipal.Text = contenedor * Txtprincipal.TextElseIf funcion = "dividir" And (Txtprincipal.Text = 0 Or Txtprincipal.Text = "") Then
MsgBox("no se puede dividir entre cero", MsgBoxStyle.Critical, "error")

ElseIf funcion ="dividir" And Txtprincipal.Text 0 Then
Txtprincipal.Text = contenedor / Txtprincipal.Text

End If
contenedor = 0
End Sub
End Class

If txtangle.Text = "90"Then
MessageBox.Show("angulo es un angulo recto")
resultado = "angulo"

ElseIf txtangle.Text "90" Then
MessageBox.Show("el angulo no es un angulo recto")resultado = "angulo"

ElseIf Txttempt.Text > "100" Then
MessageBox.Show("por encima del punto de ebullicion del agua")

ElseIf Txttempt.Text "100"...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Codigos Vb Para Excel
  • Codigos De Vb Para Botones De Navegacio
  • Codigo vb que calcula el número de vocales en una palabra
  • Codigos econde objetos vb
  • Codigo para memorama en vb
  • Código Para Hacer Una Factura En Vb 2010
  • vb bvhchch
  • Instalación VB

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS