PUBLIC ovalidviolation,oanother ovalidviolation=NEWOBJECT("valid_violation") oanother =NEWOBJECT("another") ovalidviolation.Show oanother.Show RETURN DEFINE CLASS valid_violation AS form Top = 10 Left = 10 Caption = "Form with valid check" ADD OBJECT text2 AS textbox WITH ; Left = 109, ; Top = 54 ADD OBJECT text1 AS textbox WITH ; Left = 109 ; , Top = 14 ; , Controlsource = "thisform.text2.Value" ADD OBJECT label1 AS label WITH ; AutoSize = .T., ; Caption = "Valid if empty()", ; Left = 18, ; Top = 15 ADD OBJECT label2 AS label WITH ; AutoSize = .T., ; Caption = "ControlSource", ; Left = 18, ; Top = 55 PROCEDURE text1.Valid RETURN EMPTY(m.this.value) ENDPROC ENDDEFINE DEFINE CLASS another AS form Top = 10 Left = 400 Caption = "Form with a control" ADD OBJECT text1 AS textbox WITH ; Left = 119, ; Top = 14 ADD OBJECT label1 AS label WITH ; AutoSize = .T., ; Caption = "Click on this text", ; Left = 18, ; Top = 19 ENDDEFINEUser operations:
0. Run This 1. click on "Form with valid check" 2. click on Top Textbox ( this is checked by the valid ) 3. write "pippo" 4. click on TextBox bottom *** "pippo" is written on ControlSource *** Valid stop the lose focus 5. click on "Form with control" title or formArea ( no textbox ) *** Valid stop the lose focus, but events sequence is incorrect for me --> valid_violation.textbox.valid --> valid_violation.Deactivate !!!!! why : the form is not deactivated --> valid_violation.Activate !!!!! this is a patch --> otherForm.clickForm.MouseUp --> otherForm.clickForm.Click 6. click on "Form with control" on the textBox *** VALID NOT STOP THE LOSE FOCUS --> valid_violation.textbox.Valid --> valid_violation.Deactivate --> valid_violation.Activate *** Now sequence continue !!!!!! --> otherForm.textbox.When --> valid_violation.textbox.LostFocus --> valid_violation.LostFocus --> valid_violation.Deactivate --> otherForm.Activate --> otherForm.GotFocus --> otherForm.textbox.GotFocus 7. now click on "Form with valid check" on TextBox bottom *** you go on another control of the invalid form *** click on X window buton for close the invalid formThen the Valid() return .F. it is useless.