>>PUBLIC oform1 >> >>CREATE CURSOR VisCodes ( cCode_Description V(50), cCode_Value c(10)) >>INSERT INTO VisCodes VALUES ( "EVENTS1","CODE1") >>INSERT INTO VisCodes VALUES ( "EVENTS2","CODE2") >>INSERT INTO VisCodes VALUES ( "EVENTS3","CODE3") >>INSERT INTO VisCodes VALUES ( "EVENTS4","CODE4") >>INSERT INTO VisCodes VALUES ( "EVENTS5","CODE5") >> >>oform1=NEWOBJECT("form1") >>oform1.Show >>RETURN >> >> >>DEFINE CLASS form1 AS form >> >> >> Top = 2 >> Left = 3 >> Height = 250 >> Width = 446 >> DoCreate = .T. >> Caption = "Form1" >> Name = "Form1" >> >> >> ADD OBJECT pageframe1 AS pageframe WITH ; >> ErasePage = .T., ; >> PageCount = 2, ; >> Top = 26, ; >> Left = 20, ; >> Width = 394, ; >> Height = 189, ; >> Name = "Pageframe1", ; >> Page1.Caption = "Page1", ; >> Page1.Name = "Page1", ; >> Page2.Caption = "Page2", ; >> Page2.Name = "Page2" >> >> >> >> PROCEDURE pageframe1.Page1.Activate >> KEYBOARD '{TAB}' PLAIN CLEAR >> ENDPROC >> >> PROCEDURE pageframe1.Page2.Activate >> KEYBOARD '{TAB}' PLAIN CLEAR >> ENDPROC >> >> PROCEDURE init >> this.pageframe1.page1.AddObject("COMBO1","COMBO") >> this.pageframe1.page1.COMBO1.Move(40,50) >> this.pageframe1.page1.COMBO1.Visible = .T. >> this.pageframe1.page2.AddObject("text1","textbox") >> this.pageframe1.page2.text1.Move(150,40) >> this.pageframe1.page2.text1.Visible = .T. >> >>ENDDEFINE >> >> >>DEFINE CLASS COMBO AS ComboBox >> >> PROCEDURE Init >> GO 3 >> SET MULTILOCKS on >> CURSORSETPROP("Buffering",5) >> ADDPROPERTY(m.this,"Items[1]") >> SELECT cCode_Description, cCode_Value FROM VisCodes INTO ARRAY this.Items >> >>* this don't work >> * this is a your error, because cCode_value is not a Listindex value >> this.ControlSource = 'VisCodes.cCode_value' >> this.BoundTo = .t. >> this.BoundColumn = 2 >> this.RowSourceType = 5 >> this.RowSource = "this.Items" >> && but this is a VFP's bug because VFP don't evaluate this correctly >> this.ControlSource = 'VisCodes.cCode_value' >>* this work ( comment before block and uncomment this ) >>* this.BoundTo = .t. && before ControlSource >>* this.ControlSource = 'VisCodes.cCode_value' >>* this.BoundColumn = 2 >>* this.RowSourceType = 5 >>* this.RowSource = "this.Items" >> * comment this and it don't work >>* this.ControlSource = 'VisCodes.cCode_value' >> ? this.ListIndex >> ENDPROC >>ENDDEFINE >>>
* put this in Form.gotfocus or Activate CLEAR TYPEAHEADtry2: this send the bug into a zombi pageframe
add a empty pageframe ( no pages ) with Visible = .F., and "send to back" it ( it must to be the first control on the frame )try3: this delay the Controlsource eval
* set BindControl=.f. * add this into gotfocus thisform.BindControl=.T.We are making a slalom among the bugs.