ComboBox Dinamico

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

ComboBox Dinamico

Post by AidTIC »

Buenas,

Tengo problemas con el "ComboBox".

Voy recorriendo un Dbf, y cojo los 9 conceptos como maximo que puede tener, y los quiero mostrar en un combobox, para que selecciionar uno. pero no consigo que se muestren

Code: Select all

IF Opciones->(DBSeek(mBusOpc))
		   sw_opcasi := Opciones->OPC_Asient
		   OPC := 21
		Else
		   IF LEFT(aF43 [LEN (aF43)] [OPC] + Space(38) , 38 ) <> Space(38)
		      vTemp := LEFT(aF43 [LEN (aF43)] [OPC] + Space(38) , 38 )
			//  MSGINFO(vTemp)
		      Aadd( aOpc , { vTemp }  )
	//		  ADD ITEM     { vTemp} TO Combo_Opc OF Win_Opc
	       EndIf
        Endif
		
     Next OPC
	 IF  sw_opcasi <> 0
	     MSGINFO (sw_opcasi , mBusOpc )
     Else 
	     sel_opcion (aOpc)
	 EndIf
	 

Code: Select all

*------------------------------------------------------------------------------*
Function sel_opcion ( aItems )
*------------------------------------------------------------------------------*

 
                 
DEFINE WINDOW Win_Opc         		;
		AT 0, 0				         	;
		WIDTH 900   			         ;
		HEIGHT 600				         ; 
		TITLE 'Seleción de Opción'	;
        MODAL   				
     
      DEFINE LABEL Label_01
                VALUE  "Empresa.: " + STR(cCodEmp) 
                ROW    30
                COL    10
                WIDTH  800
                HEIGHT 24
                FONTNAME CFG_FUENTE
                FONTSIZE CFG_TFUENT
                FONTBOLD .T.
                VISIBLE .T.
                FONTCOLOR {0,0,128}
      END LABEL  
	  
      DEFINE LABEL Label_02
                VALUE "Conepto Fijo.: "
                ROW    60
                COL    10
                WIDTH  100
                HEIGHT 24
                FONTNAME CFG_FUENTE
                FONTSIZE CFG_TFUENT
                NUMERIC .T. 
                FONTBOLD .T.
                VISIBLE .T.
                FONTCOLOR {0,0,128}
      END LABEL
	  
      DEFINE COMBOBOX Combo_Opc
	           PARENT Win_Opc
               ROW    60
               COL    120
               WIDTH  300
			   HEIGHT 100
               ITEMS aItems
               VALUE 1
			   FONTNAME "Arial"
               FONTSIZE 9
               TOOLTIP ""
               ONCHANGE Nil
               ONGOTFOCUS Nil
               ONLOSTFOCUS Nil
               FONTBOLD .F.
               FONTITALIC .F.
               FONTUNDERLINE .F.
               FONTSTRIKEOUT .F.
               HELPID Nil
               TABSTOP .T.
               VISIBLE .T.
               SORT .F.
               ONENTER Nil
               ONDISPLAYCHANGE Nil
               DISPLAYEDIT .F.
               IMAGE Nil
               DROPPEDWIDTH Nil
               ONDROPDOWN Nil
               ONCLOSEUP Nil
      END COMBOBOX
Image
Attachments
Captura.PNG
Captura.PNG (37.88 KiB) Viewed 2026 times
Skydone Solutions
www.skydone.com
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: ComboBox Dinamico

Post by Rathinagiri »

Unlike Grid, Combobox items should be in a single dimensional array.

So, replace the following line in your code with the correct code:

Code: Select all

Aadd( aOpc , { vTemp }  )

Code: Select all

Aadd( aOpc ,  vTemp   )
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: ComboBox Dinamico

Post by AidTIC »

Muchisimas Gracias, me ha funcionado a la primera.
Skydone Solutions
www.skydone.com
Post Reply