如何设置类模块的默认成员?
比如TextBox控件,默认Text属性,那么类模块如何自己定义默认成员呢?
[解决办法]
http://blog.csdn.net/rainstormmaster/archive/2007/04/15/1565580.aspx
暴风雨讲的是控件,同样适用于类
类模块:
Private mText As String
Public Property Get Text() As Variant
Text = mText
End Property
Public Property Let Text(ByVal vNewValue As Variant)
mText = vNewValue
End Property
窗体:
Private Sub Command1_Click()
Dim x As New Class1
x = "123 "
Print x.Text
End Sub