8,834
社区成员
发帖
与我相关
我的任务
分享
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
bool v1;
public bool V1
{
get { return v1; }
set
{
v1 = value;
//设置属性时更改控件的状态
textBox1.Enabled = v1;
}
}
public TextBox V2
{
get { return textBox1; }
}
private void UserControl1_Load(object sender, EventArgs e)
{
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
V1 = checkBox1.Checked;
}
}