PUBLIC oform1 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 ADDPROPERTY(m.this,"Items[10]","ItemX") this.RowSource = "this.Items" this.RowSourceType = 5 this.ListIndex = 1 ENDPROC ENDDEFINE>Here is our combo Init method:
>*---------------------- Location Section ------------------------ >* Library: Acustomcontrols.vcx >* Class: Cboviscodes >* Method: Init() >*----------------------- Usage Section -------------------------- >*) Description: >*) > >* Scope: Public >* Parameters: >*$ Usage: >*$ >* Returns: >*--------------------- Maintenance Section ---------------------- >* Change Log: >* CREATED 12/02/2003 - JMW >* MODIFIED >*---------------------------------------------------------------- >IF !DODEFAULT() > RETURN .F. >ENDIF > >LOCAL lcCategory, lcSubcategory, lcDept, llReturn > >lcCategory = THIS.cCategory_Description >lcSubcategory = THIS.cSubcategory_Description >lcDept = goApp.cDept > >llReturn = .T. > >IF Get_description_from_Viscodes(lcCategory, lcSubcategory, lcDept, "c_VisCodesLookup") > LOCAL lnSelect, lnRows, lnCols, laFields[1] > lnRows = RECCOUNT("c_VisCodesLookup") > > IF lnRows > 0 && our cursor does not have rows > > lnSelect = SELECT() > SELECT("c_VisCodesLookup") * lnCols = AFIELDS(laFields) DIMENSION THIS.aRowSource [m.lnRows, FCOUNT()] > COPY TO ARRAY THIS.aRowSource > > THIS.ROWSOURCETYPE = 5 && Array > THIS.ROWSOURCE = "This.aRowSource" > > SELECT (m.lnSelect) > > IF THIS.lAddBlank * This is ignored with ROWSOURCETYPE = 5 * THIS.ADDITEM("", 1, 1) > ENDIF > > THIS.BOUNDTO = .T. > > ELSE > llReturn = .F. > ENDIF > USE IN c_VisCodesLookup >ELSE > llReturn = .F. >ENDIF > >RETURN m.llReturn >>