elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  Codigo de una calculadora
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Codigo de una calculadora  (Leído 1,517 veces)
Jety

Desconectado Desconectado

Mensajes: 37


Whoever wields the sword decides who holds the pen


Ver Perfil WWW
Codigo de una calculadora
« en: 1 Septiembre 2013, 22:18 pm »

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:

Código
  1. Public Class Form1
  2.    Dim OP As String
  3.    Dim a, b, resultado As Double
  4.    Dim c As Double
  5.  
  6.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  7.  
  8.    End Sub
  9.  
  10.    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
  11.        If c = True Then
  12.            Text1.Text = ""
  13.        End If
  14.        Text1.Text = Text1.Text + "2"
  15.        c = False
  16.    End Sub
  17.  
  18.    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  19.        If c = True Then
  20.            Text1.Text = ""
  21.        End If
  22.        Text1.Text = Text1.Text + "3"
  23.        c = False
  24.    End Sub
  25.  
  26.    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
  27.        If c = True Then
  28.            Text1.Text = ""
  29.        End If
  30.        Text1.Text = Text1.Text + "4"
  31.        c = False
  32.    End Sub
  33.  
  34.    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
  35.        If c = True Then
  36.            Text1.Text = ""
  37.        End If
  38.        Text1.Text = Text1.Text + "5"
  39.        c = False
  40.    End Sub
  41.  
  42.    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
  43.        If c = True Then
  44.            Text1.Text = ""
  45.        End If
  46.        Text1.Text = Text1.Text + "6"
  47.        c = False
  48.    End Sub
  49.  
  50.    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  51.        If c = True Then
  52.            Text1.Text = ""
  53.        End If
  54.        Text1.Text = Text1.Text + "7"
  55.        c = False
  56.    End Sub
  57.  
  58.    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  59.        If c = True Then
  60.            Text1.Text = ""
  61.        End If
  62.        Text1.Text = Text1.Text + "8"
  63.        c = False
  64.    End Sub
  65.  
  66.    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  67.        If c = True Then
  68.            Text1.Text = ""
  69.        End If
  70.        Text1.Text = Text1.Text + "9"
  71.        c = False
  72.    End Sub
  73.  
  74.    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  75.        If c = True Then
  76.            Text1.Text = ""
  77.        End If
  78.        Text1.Text = Text1.Text + "0"
  79.        c = False
  80.    End Sub
  81.  
  82.    Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
  83.        Text1.Text = Text1.Text + "."
  84.    End Sub
  85.  
  86.    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
  87.        a = Text1.Text
  88.        Text1.Text = ""
  89.        OP = "SUMA"
  90.  
  91.    End Sub
  92.  
  93.    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
  94.        a = Text1.Text
  95.        Text1.Text = ""
  96.        OP = "RESTA"
  97.    End Sub
  98.  
  99.    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
  100.        a = Text1.Text
  101.        Text1.Text = ""
  102.        OP = "MULTIPLICACION"
  103.    End Sub
  104.  
  105.    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
  106.        a = Text1.Text
  107.        Text1.Text = ""
  108.        OP = "DIVISION"
  109.    End Sub
  110.  
  111.    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
  112.        b = Val(Text1.Text)
  113.        Select Case OP
  114.            Case "SUMA"
  115.                resultado = a + b
  116.                Text1.Text = resultado
  117.            Case "RESTA"
  118.                resultado = a - b
  119.                Text1.Text = resultado
  120.            Case "DIVISION"
  121.                resultado = a / b
  122.                Text1.Text = resultado
  123.            Case "MULTIPLICACION"
  124.                resultado = a * b
  125.                Text1.Text = resultado
  126.        End Select
  127.    End Sub
  128. End Class




« Última modificación: 2 Septiembre 2013, 10:48 am por EleKtro H@cker » En línea

Jety

Desconectado Desconectado

Mensajes: 37


Whoever wields the sword decides who holds the pen


Ver Perfil WWW
Re: Codigo de una calculadora
« Respuesta #1 en: 1 Septiembre 2013, 23:03 pm »

No No gracias ya pude resolverlo  :D


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
codigo de dos botones de una calculadora
Programación Visual Basic
‭lipman 4 2,724 Último mensaje 5 Noviembre 2006, 12:50 pm
por Jareth
[Código-PyQT4]Calculadora - JaAViEr
Scripting
0x5d 3 3,992 Último mensaje 7 Julio 2011, 22:21 pm
por elhacker_carlos
[Código-PyQT4]Calculadora por secuencias - JaAViEr(0x5d)
Scripting
0x5d 2 2,833 Último mensaje 27 Diciembre 2011, 02:19 am
por 0x5d
Errores con el código de una calculadora simple
Programación C/C++
petrusqui 7 4,209 Último mensaje 6 Marzo 2012, 02:46 am
por rir3760
Problema con mi código de calculadora
Programación Visual Basic
Chack22 1 1,714 Último mensaje 24 Mayo 2013, 04:45 am
por XresH
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines