Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I clear a listbox?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How do I clear a listbox?
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01155536
Message ID:
01155536
Vues:
83
I have a listbox set as follows:
.RowSourceType = 1
.RowSource = "accountant,programmer"
I allow the user to pop up a dialog where multiple items can be selected. The items that are shown in the listbox are initially selected. When the user is done selecting/deselecting items from the dialog box, the item list is returned as a comma separated string. This string is used to re-populate the listbox.

The problem is when the user deselects all items in the dialog, the string returned is empty but the listbox won't "empty" its contents. In other words, when I replace .RowSource with "", it just leaves whatever was originally displayed.

My code looks like this:
do form frmMultiList with [Ministries],[Available Ministries],[minlook.ministry],m.newmin to m.newmin

this.lstMinistries.RowSource = m.newmin
this.lstMinistries.Refresh
So, if the listbox is originally showing "accountant,programmer" and the user uses the dialog to return "secretary,painter" to m.newmin, then everything works great. The listbox shows secretary and painter in the list.

But, if the user uses the dialog to return "" to m.newmin, the listbox continues to show "accountant,programmer".

How do I get the listbox to display the empty value ... or no list?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform