• Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

whats wrong with this?

Psycho_Coder

Active Poster
Retired Staff
Active Member
it wont let me run the program, I can not find any errors in my code.....

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Calculator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Double vall, val2; //We are declaring two double variables

            //we assign to the first variable of the text box
            //to a double to assign it to "vall"

            //note that we assign using "=" as an operation

            vall = Double.Parse(textBox1.Text);
            //double.parse("string") converts the strings into brackets

            //same thing that happens for the second variable

            val2 = Double.Parse(textBox2.Text);

            //now we are doing the exact opposite
            //we double the values and convert the sum to a string
            //using the .tostring() command

            textBox3.Text = (vall + val2).ToString();
        }
    }
}
 
General chit-chat
Help Users
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    killa2! is our newest member. Welcome!
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    xperttechy is our newest member. Welcome!
  • Chat Bot:
    burhanpc is our newest member. Welcome!
  • Chat Bot:
    jerpator is our newest member. Welcome!
  • Chat Bot:
    kazuma18 is our newest member. Welcome!
  • Chat Bot:
    kazuma18 has posted a new reply in the thread "Console ID #8660".
  • Chat Bot:
    Blazed420999 is our newest member. Welcome!
  • Chat Bot:
    charlles is our newest member. Welcome!
  • Chat Bot:
    charlles has posted a new reply in the thread "Console ID #8660".
  • Chat Bot:
    CFWMODDINGCEX is our newest member. Welcome!
  • Chat Bot:
    Yote1234 is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    Mariglen is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    WxRRioR_ is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    Pinauz is our newest member. Welcome!
  • Chat Bot:
    派森寒树 is our newest member. Welcome!
  • Chat Bot:
    派森寒树 has left the room.
  • Chat Bot:
    ahagai is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
      Chat Bot: QM|T_JinX has joined the room.
      Back
      Top