Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I using code to add data into 2 column list box?
Message
De
06/12/1999 10:22:58
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
05/12/1999 23:55:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00299032
Message ID:
00299180
Vues:
18
Hi, again, E. C. :)

Here is a runnable example of how to do it. (My too-quick answers had errors, but this should work for you.)
BTW, I've added a KB FAQ with this code called "How to add items to multicolumn combos"
*!* Begin running code
*!* This is a running example of the two ways to add items to multicolumn combos.

ox = CreateObject( 'multicolumncombo' )
ox.show()
READ EVENTS
CLEAR EVENTS

**************************************************
*-- Class:        multicolumncombo (c:\development\misc\examples.vcx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   12/06/99 08:28:14 AM
*
DEFINE CLASS multicolumncombo AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT combo1 AS combobox WITH ;
		Height = 24, ;
		Left = 50, ;
		Top = 22, ;
		Width = 100, ;
		Name = "Combo1"


	ADD OBJECT combo2 AS combobox WITH ;
		Height = 24, ;
		Left = 52, ;
		Top = 79, ;
		Width = 100, ;
		Name = "Combo2"


	PROCEDURE combo1.Init
		WITH this

			.ColumnCount = 2
			.ColumnWidths = '100,100'

			.AddItem( 'Color' )
			.List( .ListCount, 2) = 'Red'

			.AddItem( 'Style' )
			.List( .ListCount, 2) = 'Dress'

			.AddItem( 'Size' )
			.List( .ListCount, 2) = 'Medium'

		ENDWITH
	ENDPROC


	PROCEDURE combo2.Init
		WITH this

			.ColumnCount = 2
			.ColumnWidths = '100,100'

			.AddListItem( 'Color', .NewItemID + 1, 1 )
			.AddListItem( 'Red', .NewItemID , 2 )

			.AddListItem( 'Style', .NewItemID + 1, 1 )
			.AddListItem( 'Dress', .NewItemID , 2 )

			.AddListItem( 'Size', .NewItemID + 1, 1 )
			.AddListItem( 'Medium', .NewItemID , 2 )

		ENDWITH
	ENDPROC


ENDDEFINE
*
*-- EndDefine: multicolumncombo
**************************************************
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform