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
| Public Event OnEnabled(ByVal Text As String)
' A faire : implémenter l'évènement alarme à la place.
'...
'Variables de propriétés:
Dim m_Id As String
'...
Private Property Get Id() As String
Id = m_Id
End Property
Public Property Let Id(ByVal UnId As String)
m_Id = UnId
End Property
Public Function DemarreCU(LId As String, EntreePC As Single, EntreePF As Single, EntreeVC As Single, EntreeVF As Single) As Boolean
' gerer les erreurs
DemarreCU = False
Id = LId
EntréePC = EntreePC
EntréePF = EntreePF
EntréeVC = EntreeVC
EntréeVF = EntreeVF
Enabled = True
DemarreCU = True
End Function
'...
Public Property Let Enabled(ByVal New_Enabled As Boolean)
Timer1.Enabled() = New_Enabled
If New_Enabled = True Then
Shapeenabled.BackColor = RGB(0, 255, 0)
LabelValPF.Caption = Format$(EntréePF, "0.0")
LabelValPC.Caption = Format$(EntréePC, "0.0")
LabelValVc.Caption = Format$(EntréeVC, "0.0")
LabelValVF.Caption = Format$(EntréeVF, "0.0")
RaiseEvent OnEnabled(Id) ' évènement de démarrage du contrôle
Else
Shapeenabled.BackColor = RGB(255, 0, 0)
End If
PropertyChanged "Enabled"
End Property |
Partager