-
Hi
I'm developing a "Flashing Led"-ocx using a timer and a shape.
I created this property:
Code:
Public Property Get Flashing() As Boolean
tmrLed.Enabled = Flashing
End Property
Public Property Let Flashing(ByVal NewFlashing As Boolean)
Flashing = NewFlashing
PropertyChanged "Flashing"
End Property
but when I try to change this property while debugging, I get a "Out of stack space"-error.
I need to be able to turn the timer on/off.
What am I doing wrong? :confused:
Edited by onerrorgoto on 02-23-2000 at 06:25 AM
-
Not sure if it's the solution for your problem, but the usual property get/let is like this:
Code:
Public Property Get MyProp() As Datatype
MyProp = MyVariableForThisProperty
End Property
Public Property Let MyProp(New_MyProp As Datatype)
MyVariableForThisProperty = New_MyProp
PropertyChanged "MyProp"
End Propery
The Get returns the value (so in your case, the Get should return the current state of the timer (enabled or not)
The Let is to assign a new value, so in your case, you should turn the timer on or off in that property handler.
Hope this helps.
-
Thank you
I hope I understood you right :) because this code is working.
Code:
Public Property Get Flashing() As Boolean
Flashing = bolFlashing
End Property
Public Property Let Flashing(ByVal NewFlashing As Boolean)
bolFlashing = NewFlashing
tmrLed.Enabled = bolFlashing
PropertyChanged "Flashing"
End Property
Now I just have to set the property to the correct state when initializing my ocx.