首页 > 代码库 > C#控制切换显示两个Panel内容

C#控制切换显示两个Panel内容

技术分享

如果两个panel重合在一起,点击不同按钮切换显示不同的panel,需要xxx.BringToFront();

private void button1_Click(object sender, EventArgs e)
    {
        
        this.panel1.Visible = true;
        this.panel2.Visible = false;
    }

    private void button2_Click(object sender, EventArgs e)
    {
        this.panel2.Visible = true;
        this.panel1.Visible = false;
        this.panel2.BringToFront();
    }

 

参考:

http://bbs.csdn.net/topics/390741533

C#控制切换显示两个Panel内容