如何向自制的控件中传参数设置某属性值?
有如下的过程,但是调用的时候(调用语句:Caption())不好用,没有按预期的去实现修改属性的功能。错误提示:invalud use of property.请教如何才能用的通。
Public Property Get Caption() As String
Caption = Lab.Caption
End Property
Public Property Let Caption(ByVal New_Caption As String)
Lab.Caption() = New_Caption
PropertyChanged "Caption"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Lab.Caption = PropBag.ReadProperty("Caption", "uid")
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Caption", Lab.Caption, "uid")
End Sub
我还自己写了如下过程:
Public Property Set Caption(ByVal New_Caption As String)
Set Lab.Caption() = New_Caption
PropertyChanged "Caption"
End Property
仍然提示有错,是另一类的错误,总之不能行得通。请指教问题何在。