重新写一个 如给一个TextBox公开Visible property get TextVisible() as boolean TextVisible=TextBox1.visible end property property Let TextVisible(value as boolean) TextBox1.visible=value end property
原来你是不知道怎么保存属性值 加上下面的过程 Private Sub UserControl_ReadProperties(PropBag As PropertyBag) textbox1.Visible = PropBag.ReadProperty("TextBox1.Visible", False) End SubPrivate Sub UserControl_WriteProperties(PropBag As PropertyBag) Call PropBag.WriteProperty("TextBox1.Visible", textbox1.Visible) End Sub
如给一个TextBox公开Visible
property get TextVisible() as boolean
TextVisible=TextBox1.visible
end property
property Let TextVisible(value as boolean)
TextBox1.visible=value
end property
加上下面的过程
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
textbox1.Visible = PropBag.ReadProperty("TextBox1.Visible", False)
End SubPrivate Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("TextBox1.Visible", textbox1.Visible)
End Sub