c# panel显示不了
来源:百度知道 编辑:UC知道 时间:2024/09/27 07:22:44
我这里有完整的代码 !! 唉,这百度说我答案重复了,我觉得确实是重复了点!但这是我亲自写的代码,根本没有抄!真没办法~~~~
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//加载时 把panel1显示,把panel2隐藏
this.panel1.Visible = true;
this.panel2.Visible = false;
}
private void button1_Click(object sender, EventArgs e)
{
//点一下按钮1把panel2隐藏,把panel1显示
this.panel2.Visible = false;
this.panel1.Visible = true;
}
private void button2_Click(object sender, EventArgs e)
{
//点一下按钮2把panel1隐藏,把panel2显示
this.panel1.Visible = false;
this.panel2.Visible = true;
}