110,537
社区成员
发帖
与我相关
我的任务
分享
List<Control> m_FormControls = new List<Control>(); //添加了3个控件进去
private void Btn_Back_Click(object sender, EventArgs e)
{
for (int i = 0; i < this.m_FormCount; i++)
{
//this.m_FormControls[2].Visible = (i == (this.m_CurrentFormIndex + 1)); //先是这么写的,以为这么写有什么Bug
//后来改成这个样子 还是不行
if (i == this.m_CurrentFormIndex + 1)
{
this.m_FormControls[i].Visible = true; //执行了这步 ,但是this.m_FormControls[i].Visible仍然是false
}
else
{
this.m_FormControls[i].Visible = false;
}
}
}
this.m_CurrentFormIndex++;
this.Lbl_PageNow.Text = (this.m_CurrentFormIndex + 1).ToString();
OnPageChanged(this, new EventArgs());
this.Btn_Back.Enabled = !(this.m_CurrentFormIndex == 0);
this.Btn_Next.Enabled = !(this.m_CurrentFormIndex == this.m_FormCount - 1);