>I want the form to close. My problem is that I also want the form to close when the user clicks on the X box, without running the textbox.valid, or at least have some way for the textbox.valid to know that the reason it fired is because the user clicks the X box, then it could just RETURN .T. and not validate.
Then in the Valid of your control class, you need to test for ThisForm.ReleaseType. If it is 1 the Close box was clicked.
See ReleaseType in VFP Help for more info.
Don't you want the Valid to run unless the user Cancel's? I do not consider anything canceled unless the user explicitly clicks the Cancel button on the form. This is just the way I do it.
Mark McCasland
Midlothian, TX USA