36106.255, formpick.Unload() 36106.286, formmain.text1.When() 36106.286, formmain.GotFocus() 36106.302, formmain.text1.GotFocus() 36106.302, formmain.text1.Message() 36106.317, formmain.command1.Valid() 36106.333, formmain.command1.When() 36106.380, formmain.Activate()And here is the code from the pick button click event:
DO FORM pickvalue TO thisform.inputvalue thisform.text1.SetFocus() THISFORM.PICKING = .F. thisform.RefreshFor some reason, as the focus comes back to my input window, the When event of the click button fires which sets the thisform.Picking flag back to .f.
PUBLIC o o = CREATEOBJECT("formmain") o.Show() ************************************************** *-- Form: formmain (c:\rest\test.scx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 01/29/08 10:21:13 AM * DEFINE CLASS formmain AS form Top = 0 Left = 0 Height = 257 Width = 408 DoCreate = .T. Caption = "Data Input Test" validated = "" picking = .F. inputvalue = "" Name = "formMain" ADD OBJECT cmdclose AS commandbutton WITH ; Top = 216, ; Left = 296, ; Height = 27, ; Width = 84, ; Caption = "Close", ; TabIndex = 3, ; Name = "cmdClose" ADD OBJECT text1 AS textbox WITH ; ControlSource = "thisform.inputvalue", ; Height = 23, ; Left = 164, ; TabIndex = 1, ; Top = 56, ; Width = 100, ; Name = "Text1" ADD OBJECT text2 AS textbox WITH ; ControlSource = "thisform.validated", ; Height = 23, ; Left = 164, ; TabIndex = 2, ; Top = 111, ; Width = 100, ; Name = "Text2" ADD OBJECT label1 AS label WITH ; AutoSize = .T., ; Caption = "Enter a value:", ; Height = 17, ; Left = 76, ; Top = 59, ; Width = 76, ; TabIndex = 4, ; Name = "Label1" ADD OBJECT label2 AS label WITH ; AutoSize = .T., ; Caption = "Valid Value?", ; Height = 17, ; Left = 76, ; Top = 114, ; Width = 70, ; TabIndex = 5, ; Name = "Label2" ADD OBJECT command1 AS commandbutton WITH ; Top = 56, ; Left = 276, ; Height = 27, ; Width = 84, ; Caption = "Pick", ; TabIndex = 6, ; Name = "Command1" PROCEDURE cmdclose.Click thisform.Release ENDPROC PROCEDURE text1.LostFocus IF (thisform.picking = .f.) thisform.Validated = "Yes" thisform.Refresh ENDIF ENDPROC PROCEDURE text1.GotFocus thisform.picking = .f. ENDPROC PROCEDURE command1.When THISFORM.PICKING = .T. ENDPROC PROCEDURE command1.Click thisform.inputvalue = INPUTBOX("Please enter a value:") thisform.text1.SetFocus() THISFORM.PICKING = .F. thisform.Refresh ENDPROC ENDDEFINE * *-- EndDefine: formmain **************************************************