111,098
社区成员




ArrayList list = new ArrayList();
int i = -1;
//下一页
private void button1_Click(object sender, EventArgs e)
{
i++;
if (i > list.Count - 1)
i = list.Count - 1;
((Panel)list[i]).Visible = true;
for (int j = 0; j < list.Count; j++)
{
if (j != i)
((Panel)list[j]).Visible = false;
}
}
//加载窗体
private void Form3_Load(object sender, EventArgs e)
{
string str = "";
foreach (Control con in this.Controls)
{
str += con.GetType().Name.ToString()+" "+con.Name.ToString()+" ";
if (con.GetType().Name.ToString() == "Panel")
{
list.Add(con);
}
}
MessageBox.Show(list.Count.ToString()+" "+str);
}
//上一页
private void button2_Click(object sender, EventArgs e)
{
i--;
if (i < 0)
i = 0;
((Panel)list[i]).Visible = true;
for (int j = 0; j < list.Count;j++ )
{
if(j!=i)
((Panel)list[j]).Visible = false;
}
}
FormChild cFormChild1 = new FormChild();
FormChild cFormChild2 = new FormChild();
FormChild cFormChild3 = new FormChild();
cFormChild1.MdiParent = this;
cFormChild2.MdiParent = this;
cFormChild3.MdiParent = this;
cFormChild1.Show();
cFormChild2.Show();
cFormChild3.Show();