Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When for custom Controls
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00596595
Message ID:
00596652
Views:
21
Correct and it always seems to run the controls GotFocus.

>Hi!
>
>Did you meant that nodefault did not work for custom control? Strange, though not so much - because there is a GotFocus also for controls inside of the custom contol...
>
>>Thanks Vlad that is exactly what I was after I will try it again as before I was unable to get a nodefault to work!
>>
>>>Hi!
>>>
>>>Add When method to the control and put the code in the GotFocus event:
>>>
>>>if empty(this.When())
>>>  this.enabled=.F.
>>>else
>>>  this.enabled=.T.
>>>endif
>>>
>>>
>>>So whenever you use this class, When event will be still available.
>>>
>>>BTW, if you do nto want to disable control when it has no access, but just disable the access, you can do following in GotFocus event:
>>>
>>>
>>>if empty(this.When())
>>>  nodefault
>>>endif
>>>
>>>
>>>Nodefault command in GotFocus event prevent control to get focus.
>>>
>>>HTH.
>>>
>>>>Hi everyone,
>>>>
>>>>I have a custom Control that I need to prevent access to under certain circumstances, however the control only appears to have a GotFocus and LostFocus not a When or Valid.
>>>>
>>>>Is there some way to reproduce the behaviour of the When method?
>>>>
>>>>Thanks in advance
Caroline
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform