Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MultiSelect Listbox Programmatic Selection Quirk
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01126812
Message ID:
01126889
Vues:
41
This message has been marked as the solution to the initial question of the thread.
I've already discovered one quirk in that the multiple selections won't be highlighted properly unless you issue a wait window with a short timeout between selections as such:
FOR x=1 TO this.ListCount
 IF this.list(x,1)=something
  this.selected(x)
  wait window 'found' timeout .1
 ENDIF
ENDFOR


Didn't you really mean
This.Selected[ x ] = .T.
Unless I include this wait window I can not get a multi-select to properly select multiple lines. Without the wait window Only the last selected line will end up selected and then only with the little dotted outline. If I keep the wait window in the code then all the selected lines are properly highlighted dark blue.

Let me guess - the code you are using is in the form's Init(). If this is the case, try adding this line of code before you set the lit box's Selected[ x ] property:
This.List.SetFocus()
Or else move this code out of the form's Init and into a different method.

On to the quirk that I can't figure out for the life of me:
The above code works fine until the user clicks in the listbox. As long as the user hasn't clicked in the listbox the above code will work over and over again (as a search function). The moment the user has clicked in the listbox, the above code no longer works as only the last selected line ends up selected and instead of being highlighted it just has the little dotted outline.


I would expect that when the user clicks on the list box, the selections would be cleared just as when you have mutliple files selected in Windows Explorer, clicking on the list clears the previous selections.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform