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:
00596640
Views:
20
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.com
ICQ #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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform