关于两个 Panel控件切换的问题
怎么实现如图所示,点个人资料就显示个人资料那一面,点安全设置就显示安全设置那一面,而且这个窗体刚打开时显示的是个人资料。如下是我写的代码publicpartialclas...
怎么实现 如图所示,点个人资料就显示个人资料那一面,点安全设置就显示安全设置那一面,而且这个窗体刚打开时显示的是个人资料。如下是我 写的代码
public partial class Form3 : Form
{
bool isEditUserInfo = true;
public Form3()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{
this.SetVisible(false);
}
public void SetVisible(bool isVisble)
{
this.panel2.Visible = isVisble;
this.button1.Visible = isVisble;
this.button2.Visible = isVisble;
}
private void button2_Click(object sender, EventArgs e)
{
isEditUserInfo = false;
this.button1.FlatStyle = FlatStyle.Standard;
this.button1.BackgroundImage = qq.Resource1.BaseInfo;
this.button2.FlatStyle = FlatStyle.Flat;
this.button2.BackgroundImage = qq.Resource1.Security;
this.SetVisible(true);
}
private void button1_Click(object sender, EventArgs e)
{
isEditUserInfo = true;
this.button1.FlatStyle = FlatStyle.Flat;
this.button1.BackgroundImage = qq.Resource1.BaseInfo;
this.button2.FlatStyle = FlatStyle.Standard;
this.button2.BackgroundImage = qq.Resource1.SecurityClick;
this.SetVisible(false);
}
请查看下有什么毛病,我一打开这个窗体按钮就没了。 this.SetVisible(false);如果这里为true的话是有显示,可是一点按钮就又没有了。。
这是第二个截图 展开
public partial class Form3 : Form
{
bool isEditUserInfo = true;
public Form3()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{
this.SetVisible(false);
}
public void SetVisible(bool isVisble)
{
this.panel2.Visible = isVisble;
this.button1.Visible = isVisble;
this.button2.Visible = isVisble;
}
private void button2_Click(object sender, EventArgs e)
{
isEditUserInfo = false;
this.button1.FlatStyle = FlatStyle.Standard;
this.button1.BackgroundImage = qq.Resource1.BaseInfo;
this.button2.FlatStyle = FlatStyle.Flat;
this.button2.BackgroundImage = qq.Resource1.Security;
this.SetVisible(true);
}
private void button1_Click(object sender, EventArgs e)
{
isEditUserInfo = true;
this.button1.FlatStyle = FlatStyle.Flat;
this.button1.BackgroundImage = qq.Resource1.BaseInfo;
this.button2.FlatStyle = FlatStyle.Standard;
this.button2.BackgroundImage = qq.Resource1.SecurityClick;
this.SetVisible(false);
}
请查看下有什么毛病,我一打开这个窗体按钮就没了。 this.SetVisible(false);如果这里为true的话是有显示,可是一点按钮就又没有了。。
这是第二个截图 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询