Information générale
Catégorie:
Programmation Orientée Object
Versions des environnements
Dear Terry,
I know it's been ages since I got back to you, but I had a problem logging on to UT. Just sorted out the problem yesterday.
With regard to the code, being a multi-column list, I just was'nt able to get it right, without data being distorted between list boxes. Finally, this is the code I've created when one double-clicks on lstSelected (the listbox with selected records), to get the double-clicked selection back into lstsource.
**REFILLING NAME AND CLASS FIELDS INTO LSTSOURCE BY FIRST CREATING A CURSOR **FROM RECORDS PRESENTLY IN LSTSOURCE THEN CLEARING THE LSTSOURCE, AND THEN **FILLING THEM IN AGAIN!
WITH THIS.Parent
CREATE CURSOR curheadssource (name C(30), class C(3))
nlistnum=1
DO WHILE nlistnum <=.lstsource.listcount
.lstsource.listindex=nlistnum
.lstsource.BoundColumn=1
SELECT curheadssource
INSERT INTO Curheadssource (NAME) VALUES (.lstsource.value)
.lstsource.BoundColumn=2
repl Curheadssource.class with .lstsource.value
nlistnum=nlistnum+1
ENDDO
**Completing the cursor by adding the final item from
**lstselected (the one that was double-clicked)....IMPORTANT
INSERT INTO CURheadssource (NAME, class) VALUES (.lstSelected.List( this.listindex, 1), .lstSelected.List( this.listindex, 2))
** Adding the new list of records again to lstsource....
.lstsource.clear
SELECT curheadssource
nrowval=0
SCAN
.lstSource.AddItem(curheadssource.NAME)
NROWVAL=NROWVAL+1
.lstSource.AddListItem(curheadssource.class,nrowval,2)
ENDSCAN
This.RemoveItem(This.ListIndex)&&Removing the item that was selected in **lstselected
ENDWITH
Thisform.LockScreen=.f.
** LONG AND CUMBERSOME, BUT I'D LOVE TO WELCOME ANY EASiER SOLUTIONS.
** HOPE I'VE NOT BURDENED YOU!
WITH BEST REGARDS,
STEVE.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement