0% found this document useful (0 votes)
21 views4 pages

Codigo Form

The document contains the code for a Windows form application that performs mathematical calculations. It defines various buttons and text boxes to accept user input and display output. The buttons trigger subroutines to perform operations like addition, multiplication, division, and mathematical functions on the input values and display the results. It also contains code to clear the form fields, close the form, and handle menu item clicks.

Uploaded by

alicona031
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Codigo Form

The document contains the code for a Windows form application that performs mathematical calculations. It defines various buttons and text boxes to accept user input and display output. The buttons trigger subroutines to perform operations like addition, multiplication, division, and mathematical functions on the input values and display the results. It also contains code to clear the form fields, close the form, and handle menu item clicks.

Uploaded by

alicona031
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Public Class Form1

Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles


TXT_NUMERO2.TextChanged

End Sub

Private Sub BTN_SUMA_Click(sender As Object, e As EventArgs) Handles


BTN_SUMA.Click

Dim a, suma, b, c As Integer 'declara variables enteras


'asigna a cada variable el valor capturado en texbox
a = TXT_NUMERO1.Text
b = TXT_NUMERO2.Text
c = TXT_NUMERO3.Text

suma = a + b + c

TXT_RESULTADOS.Text = suma 'salida de resultado

End Sub

Private Sub BTN_PRODUCTO_Click(sender As Object, e As EventArgs) Handles


BTN_PRODUCTO.Click

Dim a, producto, b, c As Integer

a = TXT_NUMERO1.Text
b = TXT_NUMERO2.Text
c = TXT_NUMERO3.Text

producto = a * b * c

TXT_RESULTADOP.Text = producto

End Sub

Private Sub BTN_COCIENTE_Click(sender As Object, e As EventArgs) Handles


BTN_COCIENTE.Click

Dim a, cociente, b As Double

a = TXT_NUMERO1.Text

b = TXT_NUMERO2.Text

cociente = a / b

TXT_RESULTADOC.Text = cociente

End Sub

Private Sub BTN_RESIDUO_Click(sender As Object, e As EventArgs) Handles


BTN_RESIDUO.Click

Dim a, residuo, c As Double

a = TXT_NUMERO1.Text

c = TXT_NUMERO3.Text
residuo = a - c

TXT_RESULTADOR.Text = residuo

End Sub

Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click

End Sub

Private Sub BTN_FUNCIONES_Click(sender As Object, e As EventArgs) Handles


BTN_FUNCIONES.Click

Dim log1, log2, seno, coseno, pot, raiz As Double

Dim a As Double

'proceso de asignacion

a = TXT_NUMERO1.Text 'El valor del textbox se deposita en la variable a


MessageBox.Show("USTED ESTA CALCULANDO FUNCIONES MATEMATICAS")
'Funciones matematicas

log1 = Math.Log(a)
log2 = Math.Log10(a)
seno = Math.Sin(a)
coseno = Math.Cos(a)
pot = Math.Pow(a, 2)
raiz = Math.Sqrt(a)

'salida de resultados
TXTSENO.Text = seno
TXTCOSENO.Text = coseno
TXTLOG10.Text = log1
TXTLOGNATURAL.Text = log2
TXTPOTENCIA.Text = pot
TXTRAIZ.Text = raiz

End Sub

Private Sub BTN_NUEVOCALCULO_Click(sender As Object, e As EventArgs) Handles


BTN_NUEVOCALCULO.Click

'Limpia los objetos

TXT_NUMERO1.Text = ""
TXT_NUMERO2.Text = ""
TXT_NUMERO3.Text = ""
TXT_RESULTADOS.Text = ""
TXT_RESULTADOP.Text = ""
TXT_RESULTADOC.Text = ""
TXT_RESULTADOR.Text = ""
TXTSENO.Text = ""
TXTCOSENO.Text = ""
TXTLOG10.Text = ""
TXTLOGNATURAL.Text = ""
TXTRAIZ.Text = ""
TXTPOTENCIA.Text = ""
'mensaje de accion
MessageBox.Show("USTED ACABA DE LIMPIAR LOS OBJETOS")
TXT_NUMERO1.Focus() 'posiciona el cursor

End Sub

Private Sub BTN_CERRAR_Click(sender As Object, e As EventArgs) Handles


BTN_CERRAR.Click

'evalua el valor calculado de el MsgBox

If MsgBox("Salir...", vbYesNo, "Esta seguro que quiere salir") =


DialogResult.Yes Then
Close() 'cierra formulario
End If
End Sub

Private Sub TXTLOGNATURAL_TextChanged(sender As Object, e As EventArgs) Handles


TXTLOGNATURAL.TextChanged

End Sub

Private Sub Lbl2_Click(sender As Object, e As EventArgs) Handles Lbl2.Click

End Sub

Private Sub SumaToolStripMenuItem_Click(sender As Object, e As EventArgs)


Handles SumaToolStripMenuItem.Click

Dim a, suma, b, c As Integer 'declara variables enteras


'asigna a cada variable el valor capturado en texbox
a = TXT_NUMERO1.Text
b = TXT_NUMERO2.Text
c = TXT_NUMERO3.Text

suma = a + b + c

TXT_RESULTADOS.Text = suma 'salida de resultado

End Sub

Private Sub CerrarFormularioToolStripMenuItem_Click(sender As Object, e As


EventArgs) Handles CerrarFormularioToolStripMenuItem.Click
If MsgBox("Salir...", vbYesNo, "Esta seguro que quiere salir") =
DialogResult.Yes Then
Close() 'cierra formulario
End If
End Sub

Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles


TextBox3.TextChanged

End Sub

Private Sub TextBox12_TextChanged(sender As Object, e As EventArgs) Handles


TextBox12.TextChanged

End Sub
Private Sub TextBox10_TextChanged(sender As Object, e As EventArgs) Handles
TextBox10.TextChanged

End Sub

Private Sub Label10_Click(sender As Object, e As EventArgs) Handles


Label10.Click

End Sub

Private Sub Label14_Click(sender As Object, e As EventArgs) Handles


Label14.Click

End Sub

Private Sub Label13_Click(sender As Object, e As EventArgs) Handles


Label13.Click

End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles


Button4.Click

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles


Button2.Click

End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles


Button5.Click

End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles


Button6.Click

End Sub
End Class

You might also like