>BUT, the lostfocus does not work the same way as the valid event. If you
>place an edit box on a form and put nodefault in its lostfocus event and
>then place a checkbox or button on the form, the checkbox can still be
>checked and the command button's click event will still be called. I am
>trying to make each control (not just date picker controls) responsible for
>its valid state in such a way that if focus leaves that control there is a
>guarantee that that control is valid.
>
>If the Lostfocus event happened before the new controls gotfocus then
>nodefault would solve all the problems. But this doesn't happen. Instead
>the gotfocus of the new control is called (and if its a command button and
>it is clicked to receive focus its click event is called) before the
>lostfocus of the old control is triggered.
>
>The only solution I have found so far is to place code in the when event
>of every control on the form so that the new control will not be entered
>if the old Control or Container is not valid.
>
>The VFP Valid event works as expected. The focus cannot leave the control
>until the Valid returns .T.
>
>Hope this clarifies what I am trying to do...
>Peter
How about calling the methods of the controls from within the LostFocus of the
container class?
Chris
Christopher Reed
"The oxen are slow, but the earth is patient."