742
社区成员
发帖
与我相关
我的任务
分享
'---------------------------------------------------------------------------------------
' Module : Class1
'---------------------------------------------------------------------------------------
Option Explicit
Private m_Value As Long
Property Get ValueCaption() As String
Dim sCaption As String
Stop
Select Case m_Value
Case 0: sCaption = "零"
Case 1: sCaption = "壹"
Case 2: sCaption = "贰"
End Select
ValueCaption = sCaption
End Property
Private Sub Class_Initialize()
m_Value = 2
End Sub
'---------------------------------------------------------------------------------------
' Module : Module1
'---------------------------------------------------------------------------------------
Option Explicit
Public Sub test()
Dim aa As Class1
Set aa = New Class1
Stop '此时到watch窗口观察,属性值已经有了
Set aa = Nothing
End Sub
private m_Value as long
Property Get ValueCaption() as string
dim sCaption as string
select case m_Value
case 0: sCaption = "零"
case 1: sCaption = "壹"
case 2: sCaption = "贰"
...
end select
ValueCaption = sCaption
End Property
Public Sub test()
Dim aa As Form1
Set aa = New Form1
Stop
End Sub