Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting listbox items in code - failing
Message
De
29/07/1998 16:02:11
Tim Hockin
Illinois State U - Residential Computing
Normal, Illinois, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Selecting listbox items in code - failing
Divers
Thread ID:
00122468
Message ID:
00122468
Vues:
44
I am attempting to select a few items in a multi-select listbox at start up, showing the user which records exist. However, I have a few problems.

in listbox.init() or form.init() (neither works) I have

*****************************************
SELECT ValidFacil
COUNT TO lnCount

DIMENSION laList[lnCount]

* figure out the current list of halls
SELECT Rooms
lnCount = 1
SCAN FOR Rooms.RateSheetNum == THISFORM.RateNum
IF (ASCAN(laList, ALLTRIM(Rooms.Hallname)) == 0)
laList[lnCount] = ALLTRIM(Rooms.Hallname)
lnCount = lnCount + 1
ENDIF
ENDSCAN

* loop thru the listbox, select correct halls
IF THISFORM.lstHalls.ListCount > 0
FOR lnCount = 1 TO THISFORM.lstHalls.ListCount
IF (ASCAN(laList, THISFORM.lstHalls.List[lnCount]) > 0)
THISFORM.lstHalls.Selected[lnCount] = .T.
ENDIF
ENDFOR
ENDIF
*****************************************

The records do NOT get selected.
If I put this in a button.click and run it, it works, until the listbox receives a paint() event (e.g. - I scroll it) and the record selections disappear again.

What I need is for it to behave as if the user selected these records.

Am I missing something, or is there a known workaround? something?

Tim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform