Public Class Form2
Dim a, b, c As Integer
Function potencia(ByVal a As Integer, ByVal b As Integer) As Integer
potencia = 1
For c = 1 To b
potencia = potencia * a
Next
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
a = TextBox1.Text
b = TextBox2.Text
Dim d As Integer = potencia(a, b)
Label3.Text = d
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form3.Show()
End Sub
End Class

No hay comentarios:
Publicar un comentario