110,536
社区成员
发帖
与我相关
我的任务
分享
namespace WindowsFormsControlLibrary1
{
public partial class UserControl1: UserControl
{
bool zhuangtai=false;
public UserControl1()
{
InitializeComponent();
}
private void UserControl1_SizeChanged(object sender, EventArgs e)
{
pictureBox1.Width = this.Width;
pictureBox1.Height = this.Height;
pictureBox2.Width = this.Width;
pictureBox2.Height = this.Height;
}
public bool state
{
get
{
return zhuangtai;
}
set
{
zhuangtai = value;
if(zhuangtai)
{
pictureBox1.Visible = false;
pictureBox2.Visible = true;
}
else
{
pictureBox2.Visible = false;
pictureBox1.Visible = true;
}
}
}
}
}