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 WindowsFormsApplication22
{
public partial class Form1 : Form
{
private double subTotal = 0;
public Form1()
{
InitializeComponent();
}
private void btmAddItem_Click(object sender, EventArgs e)
{
double numberOne;
double numberTwo;
double total;
double Counter;
numberOne = Convert.ToDouble(txtQuantity.Text);
numberTwo = Convert.ToDouble(txtPrice.Text);
total = numberOne * numberTwo;
Counter = total;
subTotal = 0;
listBox1.Text = Convert.ToString(total);
lblSub.Text = Convert.ToString(total);
listBox1.Items.Add(txtName.Text.PadRight(60) + txtQuantity.Text.PadRight(35) + txtPrice.Text);
listBox2.Items.Add(total);
lblTotal.Text = listBox2.Items.Count.ToString();
int i = 0;
for (i = 0; i < listBox2.Items.Count - 1; ++i);
foreach (var item in listBox2.Items)
txtName.Text = "";
txtQuantity.Text = "";
txtPrice.Text = "";
}
}
}
Paul_37 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.