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:
00596620
Views:
21
>>>>>>>>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
>>>>>>>
>>>>>>>what about setting the controls 'enabled' property to 'FALSE'?
>>>>>>>The user will not have 'access' to the control.
>>>>>>>When the 'certain circumstance' occurs...
>>>>>>>
>>>>>>>THISFORM.Control.Enabled = .f.
>>>>>>>
>>>>>>>or
>>>>>>>
>>>>>>>THISFORM.Control.ReadONly = .t. is another way to limit user access to a control.....
>>>>>>>
>>>>>>>
>>>>>>>i hope this helps...
>>>>>>>if it does not...
>>>>>>>... get more specific with your question..
>>>>>>
>>>>>>
>>>>>>I guess that the real problem is that I can only test if they can access the control within the control ie what should be the When method.
>>>>>>
>>>>>>Any thoughts?
>>>>>
>>>>>so when the user alters the contents of the control ... you would want to disable it ?
>>>>>
>>>>>try the
>>>>>'interactivechange' event of the control....
>>>>
>>>>Sorry I'm not being very clear today - I go on holiday tomorrow so.....
>>>>
>>>>What I need to happen is that the user clicks on a custom scrollbar the scrollbar then calls the necessary code to check if the current record needs to be saved, if it does the user gets a question, depending on the answer the scroll may be stopped leaving the user on the previous record.
>>>>
>>>>From the GotFocus I can't seem to stop the scroll happening!
>>>
>>>i did not know you could subclass a 'scrollbar' ?
>>>
>>>is this scroll bar ...
>>>part of a grid? or a combobox ... or what?
>>
>>No I've created a custom control with 3 buttons in it and programmed the functionality of a scroll bar (as in record next/previous/top etc).
>>
>>Part of my problem is that the user could be trying to do a number of things when they click on my scrollbar and I need to prevent all of them - hence the fact that I want to do the check in the When/GotFocus of the control before the button within performs its code.
>
>Note that we have custom scrollbars just the same, but you seem to approach something differently here; I assume the user clicks on a scrollbar button and during MouseDown scrolling is performed ? and not that another click is needed to stop scrolling ?

Thats correct - so when are you checking that its ok for the user to move from the current record?
Caroline
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform