-
How can i know when a property in ocx change.
I mean something like event that tell me when user of the control change the value of the property that i made.
For example
I have make a property named BarValue.
When a user change the value of bar1.barvalue like this
Bar1.BarValue=15 the i want to know when the user made that to execute a procedure that i make like to change the view of bar.
I don't know if you can understand me but i hope that help you.
Thank's
-
The Property Let of Your BarValue property should look something like this.
Code:
Public Property Let BarValue(New_BarValue As Single)
m_BarValue = New_BarValue 'm_BarValue Holds the value of the property
PropertyChanged "BarValue" ' You may not have this, this is to make the property Persistant, don't worry if you don't
End Property
I'm assuming that you want to update the userControl when this property is changed.
Have a subrouting Called Update which redraws the Control. And change the property Let to this
Code:
Public Property Let BarValue(New_BarValue As Single)
m_BarValue = New_BarValue 'm_BarValue Holds the value of the property
PropertyChanged "BarValue" ' You may not have this, this is to make the property Persistant, don't worry if you don't
Call Update() 'This is the new line which calls your update procedure
End Property