0
當前我在學校項目中使用了下面這些代碼的GUI:我想讓某些標籤/文本框在點擊按鈕提交後出現,我該怎麼做?謝謝!關於c#圖形用戶界面(點擊按鈕)某些標籤會出現
using System.Windows.Forms;
namespace SchoolProject
{
public partial class Clothes : Form
{
public Clothes()
{
InitializeComponent();
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
double Red1 = 13.00;
double Blue1 = 12.00;
double Green1 = 11.00;
double Red2 = 6.00;
double Blue2 = 7.00;
double Green2 = 8.00;
double total;
if (rbnRed1.Checked && rbnRed2.Checked)
{
total = Red1 + Red2;
MessageBox.Show("Red Tee & Red Crop Tee" + "Total:$ " + total.ToString("0.00"));
}
if (rbnRed1.Checked && rbnBlue2.Checked)
{
total = Red1 + Blue2;
MessageBox.Show("Red Tee & Blue Crop Tee" + "Total: $" + total.ToString("0.00"));
}
if (rbnRed1.Checked && rbnGreen2.Checked)
{
total = Red1 + Green2;
MessageBox.Show("Red Tee & Green Crop Tee" + "Total:$ " + total.ToString("0.00"));
}
//=======
if (rbnBlue1.Checked && rbnRed2.Checked)
{
total = Blue1 + Blue2;
MessageBox.Show("Blue Polo & Blue Crop Tee" + "Total:$ " + total.ToString("0.00"));
}
if (rbnBlue1.Checked && rbnBlue2.Checked)
{
total = Red1 + Blue2;
MessageBox.Show("Red Polo Tee & Blue Crop Tee" + "Total: $" + total.ToString("0.00"));
}
if (rbnBlue1.Checked && rbnGreen2.Checked)
{
total = Red1 + Green2;
MessageBox.Show("Red Polo Tee & Green Crop Tee" + "Total:$ " + total.ToString("0.00"));
}
//===========
if (rbnGreen1.Checked && rbnRed2.Checked)
{
total = Red1 + Red2;
MessageBox.Show("Red Polo Tee & Red Crop Tee" + "Total:$ " + total.ToString("0.00"));
}
if (rbnGreen1.Checked && rbnBlue2.Checked)
{
total = Red1 + Blue2;
MessageBox.Show("Red Polo Tee & Blue Crop Tee" + "Total: $" + total.ToString("0.00"));
}
if (rbnGreen1.Checked && rbnGreen2.Checked)
{
total = Red1 + Green2;
MessageBox.Show("Red Polo Tee & Green Crop Tee" + "Total:$ " + total.ToString("0.00"));
}
}
private void groupBox2_Enter(object sender, EventArgs e)
{
}
}
}
謝謝!編碼還是新的,它起作用:> –