|
-
Feb 22nd, 2000, 06:19 PM
#1
Thread Starter
Hyperactive Member
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? 
Edited by onerrorgoto on 02-23-2000 at 06:25 AM
Onerrorgoto
Dont be to optimistic, the light at the end of the tunnel might be a train
-
Feb 22nd, 2000, 08:35 PM
#2
Hyperactive Member
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.
-
Feb 22nd, 2000, 10:56 PM
#3
Thread Starter
Hyperactive Member
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.
Onerrorgoto
Dont be to optimistic, the light at the end of the tunnel might be a train
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|