VB6にてクラスの利用


Dim a As Class1
Dim b As Class1
Set a = New Class1
Set b = a
Text1.Text = b.test("minoru")
Set b = Nothing


------Class1ファイル-------


Public data As String

Function test(str As String) As String
test = data + str
End Function

Private Sub Class_Initialize()
data = "inaba "
MsgBox ("コンストラクタ")
End Sub

Private Sub Class_Terminate()
MsgBox ("デストラクタ")
End Sub




▲トップページ > Visual BASIC と C#