>oform = CREATEOBJECT('Test') >oform.show >READ EVENTS > >DEFINE CLASS test AS form > > Top = 0 > Left = 0 > Height = 162 > Width = 375 > DoCreate = .T. > Caption = "Test Form" > Name = "Form1" > > > ADD OBJECT combo1 AS combobox WITH ; > Height = 24, ; > Left = 96, ; > Top = 96, ; > Width = 252, ; > Name = "Combo1" > > > ADD OBJECT text1 AS textbox WITH ; > Height = 23, ; > Left = 96, ; > ReadOnly = .T., ; > Top = 25, ; > Width = 144, ; > Name = "Text1" > > > ADD OBJECT label1 AS label WITH ; > AutoSize = .F., ; > BackStyle = 0, ; > Caption = "Alias", ; > Height = 17, ; > Left = 24, ; > Top = 29, ; > Width = 29, ; > Name = "Label1" > > > ADD OBJECT label2 AS label WITH ; > AutoSize = .F., ; > BackStyle = 0, ; > Caption = "Fields", ; > Height = 17, ; > Left = 24, ; > Top = 102, ; > Width = 36, ; > Name = "Label2" > > > ADD OBJECT text2 AS textbox WITH ; > Height = 23, ; > Left = 95, ; > ReadOnly = .T., ; > Top = 61, ; > Width = 253, ; > Name = "Text2" > > > ADD OBJECT label3 AS label WITH ; > AutoSize = .F., ; > BackStyle = 0, ; > Caption = "File", ; > Height = 17, ; > Left = 23, ; > Top = 65, ; > Width = 29, ; > Name = "Label3" > > > PROCEDURE Init > DODEFAULT() > > this.addproperty("select_file",'') > LOCAL lcTable > lctable = GETFILE('DBF','Select a DBF') && Chose a dbf > IF !EMPTY(lctable) > use (lctable) ALIAS mytable > IF !EMPTY(ALIAS()) .or. DBF() = lctable > this.select_file = ALIAS() > this.AddProperty('my_fields[1]',.F.) > =AFIELDS(ThisForm.my_fields,JUSTSTEM(ThisForm.select_file))&& error at this line > ThisForm.combo1.RowSourceType = 5 > ThisForm.combo1.RowSource = [ThisForm.my_fields] > ThisForm.combo1.Value = ThisForm.my_fields[1] > ThisForm.combo1.Refresh() > ThisForm.Combo1.Interactivechange() > ThisForm.text1.value = JUSTSTEM(ThisForm.select_File) > Thisform.text2.value = DBF() > ENDIF > ENDIF > RETURN .T. > ENDPROC > > PROCEDURE Destroy > CLEAR EVENTS > DODEFAULT() > ENDPROC > > PROCEDURE text1.Refresh > this.disabledbackcolor = thisform.combo1.backcolor > DODEFAULT() > ENDPROC > > > PROCEDURE text2.Refresh > this.disabledbackcolor = thisform.combo1.backcolor > DODEFAULT() > ENDPROC > > >ENDDEFINE >