Ejemplo:
Código de menús
Public Class FrmInicio
Private Sub Button3_Click(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles Button3.Click
End
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmAreas.Show()
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
Me.Hide()
FrmAtri.Show()
End Sub
Private Sub TrianguloToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles TrianguloToolStripMenuItem.Click
Me.Hide()
FrmAtri.Show()
End Sub
Private Sub CuadradoToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles CuadradoToolStripMenuItem.Click
Me.Hide()
FrmAcuad.Show()
End Sub
Private Sub CirculoToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles CirculoToolStripMenuItem.Click
Me.Hide()
FrmAcir.Show()
End Sub
Private Sub RectuanguloToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles RectuanguloToolStripMenuItem.Click
Me.Hide()
Frmprec.Show()
End Sub
Private Sub TrianguloToolStripMenuItem1_Click(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles TrianguloToolStripMenuItem1.Click
Me.Hide()
FrmPrec.Show()
End Sub
Private Sub
CuadradoToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
CuadradoToolStripMenuItem1.Click
Me.Hide()
FrmPcuad.Show()
End Sub
Public Class FrmAcir
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Dim a As Double
Dim pi As Double = 3.1416
a = radio.Text
a = a * a * pi
resultado.Text = Trim(a)
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
radio.Text = ""
resultado.Text = ""
radio.Focus()
End Sub
Private Sub FrmAcir_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public
Class FrmAcuad
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub TextBox1_TextChanged(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
numero1.TextChanged
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
Dim
area As Integer
area = numero1.Text
area = area * area
resultado.Text = Trim(area)
End Sub
Private Sub Label3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Label3.Click
End Sub
Private Sub numero2_TextChanged(ByVal
sender As System.Object,
ByVal e As
System.EventArgs)
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
numero1.Text = ""
resultado.Text = ""
numero1.Focus()
End Sub
Private Sub FrmAcuad_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End
Class
Public
Class FrmAreas
Private Sub Button5_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button5.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmAcuad.Show()
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
Me.Hide()
FrmAtri.Show()
End Sub
Private Sub Button4_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button4.Click
Me.Hide()
FrmAcir.Show()
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Me.Hide()
FrmArec.Show()
End Sub
Private Sub FrmAreas_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public Class FrmArec
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Dim a As Integer
Dim b As Integer
Dim
area As Integer
a = base.Text
b
= altura.Text
area = a * b
resultado.Text = Trim(area)
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
base.Text = ""
altura.Text = ""
resultado.Text = ""
base.Focus()
End Sub
Private Sub FrmArec_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public
Class FrmAtri
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Dim a As Integer
Dim b As Integer
Dim
area As Integer
b = altura.Text
a = base.Text
area = a * b / 2
resultado.Text = Trim(area)
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
base.Text = ""
altura.Text = ""
resultado.Text = ""
base.Focus()
End Sub
Private Sub FrmAtri_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public
Class FrmPcir
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub TextBox2_TextChanged(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
resultado.TextChanged
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Dim a As Integer
Dim perimetro As Integer
a =
radio.Text
perimetro = 3.1416 * a * a
resultado.Text = Trim(perimetro)
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
radio.Text = ""
resultado.Text = ""
radio.Focus()
End Sub
Private Sub FrmPcir_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public Class FrmPcuad
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Dim a As Integer
Dim
area As Integer
a = perimetro.Text
area = a * 4
resultado.Text = Trim(area)
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
perimetro.Text = ""
resultado.Text = ""
perimetro.Focus()
End Sub
Private Sub FrmPcuad_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public
Class FrmPerimetros
Private Sub Button5_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button5.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmPcuad.Show()
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
Me.Hide()
FrmPtri.Show()
End Sub
Private Sub Button4_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button4.Click
Me.Hide()
FrmPcir.Show()
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Me.Hide()
Frmprec.Show()
End Sub
Private Sub FrmPerimetros_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public
Class Frmprec
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub TextBox3_TextChanged(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
numero2.TextChanged
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Dim a As Integer
Dim b As Integer
Dim perimetro As Integer
a =
numero1.Text
perimetro = a + a + a + a
TextBox2.Text = Trim(perimetro)
End Sub
Private Sub Frmprec_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
Public
Class FrmPtri
Private Sub Button1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
Me.Hide()
FrmInicio.Show()
End Sub
Private Sub Label1_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Label1.Click
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button3.Click
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim
perimetro As Integer
a = numero1.Text
b = numero2.Text
c = numero3.Text
perimetro = a + b + c
resultado.Text = Trim(perimetro)
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Button2.Click
numero1.Text = ""
numero2.Text = ""
numero3.Text = ""
resultado.Text
= ""
numero1.Focus()
End Sub
Private Sub FrmPtri_Load(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
MyBase.Load
End Sub
End Class
PANTALLAZOS:
No hay comentarios:
Publicar un comentario