Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListBox/ AddItem/ AddList Item
Message
 
 
À
05/05/2003 09:58:44
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00784905
Message ID:
00785147
Vues:
17
John,

You can change your code as follows
		WITH THIS.Parent.lstSelected
			.AddItem(THIS.Parent.lstSource.List(nCnt,1))
			.List(.NewIndex, 2) = THIS.Parent.lstSource.List(nCnt,2)
			.RemoveItem(nCnt)
		ENDWITH
>I am using the Moverlists class provided with VFP 7.0 to allow a user to select items from a listbox (lstSource) and transfer them into another listbox (lstSelected).
>
>Adding items is accomplished by the following code:
>nCnt = 1
>DO WHILE nCnt <= THIS.Parent.lstSource.ListCount
>	IF THIS.Parent.lstSource.Selected(nCnt)
>		THIS.Parent.lstSelected.AddItem(THIS.Parent.lstSource.List(nCnt))
>		THIS.Parent.lstSource.RemoveItem(nCnt)
>	ELSE
>		nCnt = nCnt + 1
>	ENDIF
>ENDDO
>
>It works fine except that I modified my Listboxes to be 2 colums each.
>When I add the item selected to the lstSelected listbox I am losing my 2nd column.
>
>Will THIS.Parent.lstSource.List(nCnt) need to me modified in order to transfer all columns?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform