1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
'------le module de class s'appelle CTaskVB(nom de class)---------
'local variable(s) to hold property value(s)
Private mvarNomPerso As String 'local copy
Private mvarNomTache As String 'local copy
' ---------Ajouter une Reference au projet .Net LibNetToCom-------------
Private mvarTask As C_Task 'local copy
'-----------Properties------------------------
Public Property Let NomPerso(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.NomPerso = 5
mvarNomPerso = vData
End Property
Public Property Get NomPerso() As String
'used when retrieving value of a property, on the right side of an assignment.
NomPerso = mvarNomPerso
End Property
Public Property Let NomTache(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
mvarNomTache = vData
End Property
Public Property Get NomTache() As String
'used when retrieving value of a property, on the right side of an assignment.
NomTache = mvarNomTache
End Property
' ---------PROPERTY REFERENCE au Class NET------------------------
Public Property Let Task(ByVal vData As C_Task)
'used when assigning a value to the property, on the left side of an assignment.
Set mvarTask = vData
End Property
Public Property Get Task() As C_Task
'used when retrieving value of a property, on the right side of an assignment.
Set Task = mvarTask
End Property
'----------------------------------------
' ---------SUB DE TEST-------------------
'----------------------------------------
Public Sub GetTache()
'Affecte à CTaskVB
Me.NomPerso = Me.Task.NomPerso
Me.NomTache = Me.Task.NomTache
'Modifie et renvoie les valeurs de CtaskVB
Set Me.Task.NomPerso = "from vb6..." & Me.NomPerso
Set Me.Task.NomTache = "from vb6..." & Me.NomTache
End Sub |
Partager