Windows窗体应用程序:我有一个问题,创建一个变量来检查是否仍是一个按钮上的形式,或者如果它已被删除,以打开另一种形式......请帮助。
这里是按钮的代码片段:
private void button6_Click(object sender, EventArgs e)
{
button6.Text = "4";
if (t == "")
{
t = button6.Text;
}
else
{
if (w == "")
{
w = button6.Text;
if (w == t)
{
this.Controls.Remove(button7);
this.Controls.Remove(button6);
}
else
{
foreach (Control ctrl in this.Controls)
{
if (ctrl is Button)
{
ctrl.ResetText();
}
}
}
}
else
{
w = "";
t = "";
t = button6.Text;
}
}
}