Results 1 to 2 of 2

Thread: Property in Ocx

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Thessaloniki ,Greece
    Posts
    100
    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

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width