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
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.