我做了个自定义控件,其中有一些控件,他们的Visible属性,在Active控件接口向导中找不到,请那位大虾指点一二。
重新写一个
如给一个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 Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("TextBox1.Visible", textbox1.Visible)
End Sub
楼上正解,你没有保存设置的属性,启动后又恢复到初始属性了