我正在尝试创建一个简单的通用订单表单。什么是最简单的方法来复选框,以便当您单击这些框时,它们被添加到购物车时添加到$ 2.00基本价格并在右侧的texboxt中表示。我还尝试在单击按钮时更改总标签的文本,但在运行时不会更改。有任何想法吗?我附上了设计表格的图片,这样就可以更容易地看到我试图去做的事情。
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 Cake_Coffee_Ordering
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Add coffee to cart button
private void Button1_click(object sender, EventArgs e)
{
label1.Text = " Change in label";
}
//clear right richtext box and total label
private void Button2_click(object sender, EventArgs e)
{
richTextBox1.Text = " ";
}
//checkout popup alert with total and message
private void Button3_click(object sender, EventArgs e)
{
System.Windows.Forms.MessageBox.Show("Total here");
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void label3_Click(object sender, EventArgs e)
{
}
}
}