OVH Cloud OVH Cloud

ActiveX WriteProperties

1 réponse
Avatar
Tiouane
Bonjour,

J'ai créé un activeX. Lorsque je le colle dans un projet, l'événement
Initproperties se déclenche bien, le readproperties se déclenche bien mais
je n'ai pas le writeproperties. Pourtant, j'ai bien mis dans mes procédure
property let l'instruction propertychanged "propriété1".

Quelqu'un à une idée sur ce qui peut clocher ?

Merci d'avance de vos avis éclairés.

François Teinturier

Voici le code :
Const m_def_X1 = 0
Const m_def_X2 = 0
Const m_def_Y1 = 0
Const m_def_Y2 = 0

Dim m_X(10) As Double
Dim m_Y(10) As Double

Public Property Get X0() As Double
Attribute X0.VB_Description = "Coordonnée horizontale du premier point"
Attribute X0.VB_MemberFlags = "4"
X0 = m_X(0)
End Property

Public Property Let X0(New_Value As Double)
Ligne(0).X1() = New_Value
m_X(0) = New_Value
Libelle_Pente (0)
PropertyChanged "X0"
End Property

Public Property Get Y0() As Double
Attribute Y0.VB_Description = "Coordonnée verticale du premier point"
Attribute Y0.VB_MemberFlags = "4"
Y0 = m_Y(0)
End Property

Public Property Let Y0(New_Value As Double)
Ligne(0).Y1() = New_Value
m_Y(0) = New_Value
Libelle_Pente (0)
PropertyChanged "Y0"
End Property

Private Sub UserControl_InitProperties()
m_X(0) = m_def_X1: m_X(1) = m_def_X1: m_X(2) = m_def_X1: m_X(3) =
m_def_X1
m_X(4) = m_def_X1: m_X(5) = m_def_X1: m_X(6) = m_def_X1: m_X(7) =
m_def_X1
m_X(8) = m_def_X1: m_X(9) = m_def_X1: m_X(10) = m_def_X1
m_Y(0) = m_def_Y1: m_Y(1) = m_def_Y1: m_Y(2) = m_def_Y1: m_Y(3) =
m_def_Y1
m_Y(4) = m_def_Y1: m_Y(5) = m_def_Y1: m_Y(6) = m_def_Y1: m_Y(7) =
m_def_Y1
m_Y(8) = m_def_Y1: m_Y(9) = m_def_Y1: m_Y(10) = m_def_Y1
End Sub

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
'Lecture des propriétés de l'activeX
m_X(0) = PropBag.ReadProperty("X0", m_def_X1): m_Y(0) =
PropBag.ReadProperty("Y0", m_def_Y1)
m_X(1) = PropBag.ReadProperty("X1", m_def_X1): m_Y(1) =
PropBag.ReadProperty("Y1", m_def_Y1)

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
'Ecriture des propriétés de l'activeX
'Procédure déclenchée lors de la destruction d'une instance du controle en
mode création

Call PropBag.WriteProperty("X0", m_X(0), m_def_X1): Call
PropBag.WriteProperty("Y0", m_Y(0), m_def_Y1)
Call PropBag.WriteProperty("X1", m_X(1), m_def_X1): Call
PropBag.WriteProperty("Y1", m_Y(1), m_def_Y1)

1 réponse

Avatar
Tiouane
Personne n'a eu le problème ?

"Tiouane" a écrit dans le message de news:
42a73675$0$24384$
Bonjour,

J'ai créé un activeX. Lorsque je le colle dans un projet, l'événement
Initproperties se déclenche bien, le readproperties se déclenche bien mais
je n'ai pas le writeproperties. Pourtant, j'ai bien mis dans mes procédure
property let l'instruction propertychanged "propriété1".

Quelqu'un à une idée sur ce qui peut clocher ?

Merci d'avance de vos avis éclairés.

François Teinturier

Voici le code :
Const m_def_X1 = 0
Const m_def_X2 = 0
Const m_def_Y1 = 0
Const m_def_Y2 = 0

Dim m_X(10) As Double
Dim m_Y(10) As Double

Public Property Get X0() As Double
Attribute X0.VB_Description = "Coordonnée horizontale du premier point"
Attribute X0.VB_MemberFlags = "4"
X0 = m_X(0)
End Property

Public Property Let X0(New_Value As Double)
Ligne(0).X1() = New_Value
m_X(0) = New_Value
Libelle_Pente (0)
PropertyChanged "X0"
End Property

Public Property Get Y0() As Double
Attribute Y0.VB_Description = "Coordonnée verticale du premier point"
Attribute Y0.VB_MemberFlags = "4"
Y0 = m_Y(0)
End Property

Public Property Let Y0(New_Value As Double)
Ligne(0).Y1() = New_Value
m_Y(0) = New_Value
Libelle_Pente (0)
PropertyChanged "Y0"
End Property

Private Sub UserControl_InitProperties()
m_X(0) = m_def_X1: m_X(1) = m_def_X1: m_X(2) = m_def_X1: m_X(3) =
m_def_X1
m_X(4) = m_def_X1: m_X(5) = m_def_X1: m_X(6) = m_def_X1: m_X(7) =
m_def_X1
m_X(8) = m_def_X1: m_X(9) = m_def_X1: m_X(10) = m_def_X1
m_Y(0) = m_def_Y1: m_Y(1) = m_def_Y1: m_Y(2) = m_def_Y1: m_Y(3) =
m_def_Y1
m_Y(4) = m_def_Y1: m_Y(5) = m_def_Y1: m_Y(6) = m_def_Y1: m_Y(7) =
m_def_Y1
m_Y(8) = m_def_Y1: m_Y(9) = m_def_Y1: m_Y(10) = m_def_Y1
End Sub

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
'Lecture des propriétés de l'activeX
m_X(0) = PropBag.ReadProperty("X0", m_def_X1): m_Y(0) =
PropBag.ReadProperty("Y0", m_def_Y1)
m_X(1) = PropBag.ReadProperty("X1", m_def_X1): m_Y(1) =
PropBag.ReadProperty("Y1", m_def_Y1)

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
'Ecriture des propriétés de l'activeX
'Procédure déclenchée lors de la destruction d'une instance du controle en
mode création

Call PropBag.WriteProperty("X0", m_X(0), m_def_X1): Call
PropBag.WriteProperty("Y0", m_Y(0), m_def_Y1)
Call PropBag.WriteProperty("X1", m_X(1), m_def_X1): Call
PropBag.WriteProperty("Y1", m_Y(1), m_def_Y1)