dhru patel

dhru patel

  • NA
  • 9
  • 20.3k

Increasing Textbox amount as button is clicked.

Feb 22 2011 2:32 PM
 Hello,

 I have to make a soda machine software. I'm very new to programming and I'm trying to make this thing work. I have buttons for Dollar note, quarters, dime, nickel. And what i want is the user to click on it and show the incremented amount in textbox. I'm just so frustrated because I simple don't know how to make it work. i tried ++dollarAmount ad everything but no success. 

Im putting the code to form1.cs and I've also attached the entire zip file if you want to take a look at it.

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 VendingMachine
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            txtboxInstructions.Text = "Please click on the amount that you would like to enter.";
        }

        private void btnClear_Click(object sender, EventArgs e)
        {
            txtBoxAmount.Text = "";
            txtBoxSelection.Text = "";
        }

     }
}


Attachment: VendingMachine.zip

Answers (5)