我希望该过程(当我单击 btnWeiss 按钮时)仅在之前单击 txbStart_MouseClick 时才开始。所以我需要一个如果。但我怎么说:
txbStart_MouseClick == true ? ( if( txbMouseClick ==true) <-- i get an error^^)
我的代码如下:
private void btnWeiss_Click(object sender, EventArgs e)
{
int summe = 0, z;
lblAnzeige.Text = " ";
while (summe <= 0)
{
z = r.Next(1, 6);
summe = summe + z;
}
lblAnzeige.Text += colors[summe - 1] + "\n";
if (ckbExtrem.Checked == false)
{
lblAnzeige.ForeColor = myColors[Farbe.Next(myColors.Count)];
}
else
{
lblAnzeige.ForeColor = Color.FromArgb(Farbe.Next(256), Farbe.Next(256), Farbe.Next(256));
}
}
private void txbStart_MouseClick(object sender, MouseEventArgs e)
{
int summe = 0, z;
lblAnzeige.Text = " ";
txbStart.Text = " ";
textBox1.Text = " ";
while (summe <= 0)
{
z = r.Next(1, 6);
summe = summe + z;
}
lblAnzeige.Text += colors[summe - 1] + "\n";
if (ckbExtrem.Checked == false)
{
lblAnzeige.ForeColor = myColors[Farbe.Next(myColors.Count)];
}
else
{
lblAnzeige.ForeColor = Color.FromArgb(Farbe.Next(256), Farbe.Next(256), Farbe.Next(256));
}