Hola amigos, vieras que soy un poco nuevo en esto de la programación y hoy estuve haciendo este código en visual studio y a la hora de compilarlo no podía, quisiera que me ayudaran a corregirlo:
Public Class Form1
Dim OP As String
Dim a, b, resultado As Double
Dim c As Double
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "2"
c = False
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "3"
c = False
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "4"
c = False
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "5"
c = False
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "6"
c = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "7"
c = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "8"
c = False
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "9"
c = False
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If c = True Then
Text1.Text = ""
End If
Text1.Text = Text1.Text + "0"
c = False
End Sub
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
Text1.Text = Text1.Text + "."
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
a = Text1.Text
Text1.Text = ""
OP = "SUMA"
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
a = Text1.Text
Text1.Text = ""
OP = "RESTA"
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
a = Text1.Text
Text1.Text = ""
OP = "MULTIPLICACION"
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
a = Text1.Text
Text1.Text = ""
OP = "DIVISION"
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
b = Val(Text1.Text)
Select Case OP
Case "SUMA"
resultado = a + b
Text1.Text = resultado
Case "RESTA"
resultado = a - b
Text1.Text = resultado
Case "DIVISION"
resultado = a / b
Text1.Text = resultado
Case "MULTIPLICACION"
resultado = a * b
Text1.Text = resultado
End Select
End Sub
End Class
No No gracias ya pude resolverlo :D