dhru patel

dhru patel

  • NA
  • 9
  • 20.4k

Converting textbox to Numbers

Jan 23 2011 2:14 PM
Hello

I'm new to this C# programming and I have an assignment to do. We are creating an Amortization Report in Visual Basic 2010.

So far I have three input boxes (Principal, Interest Rate, and Term) and a Submit button. I have to convert those three input boxes to double types. How in the world do I do that? Please help.. Here's my code.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

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

        // This is the Principal : text. Not the textbox.
        private void label1_Click(object sender, EventArgs e)
        {

        }

        // This is the Interest Rate :. Not the textbox.
        private void Rate_Click(object sender, EventArgs e)
        {

        }

        // This is the Term: . Not the textbox for it.
        private void Term_Click(object sender, EventArgs e)
        {

        }

        // This is the Principal textbox. This is where you put principal amount.
        private void principaltxt_TextChanged(object sender, EventArgs e)
        {
            
            
        }

        // This is the Interest Rate textbox. Put the rate of your interest here.
        private void txtrate_TextChanged(object sender, EventArgs e)
        {

        }

        // This is the Term textbox. The terms of your loan.
        private void txtterm_TextChanged(object sender, EventArgs e)
        {

        }

        // This is the Submit button. 
        private void btnsubmit_Click(object sender, EventArgs e)
        {
            double Rate = Convert.ToDouble(txtrate.Text);
            double principal = Convert.ToDouble(txtprincipal.Text);

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void label1_Click_1(object sender, EventArgs e)
        {

        }

                

        
    }
}



Answers (4)