Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox value resets to blank
Message
De
23/11/2013 08:14:35
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 5
OS:
Windows XP SP3
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01588496
Message ID:
01588546
Vues:
111
Hi Brad,

I've found that these combo boxes work best with arrays.
Use your sql statement to populate an intrinsic array like this.ialist,
then when you type something not in the array into the box, re-dim the
array and insert the value with code something like this:

local lctext,lcexact,lnarrlen

lctext=iif(empty(this.value),alltrim(this.text),alltrim(this.value))
lcexact=set("exact")
lnarrlen=0

set exact on
with this
if !empty(lctext)
if ascan(.ialist,lctext)=0
lnarrlen=alen(.ialist)+1
dimension .ialist[lnarrlen]
ains(.ialist,1)
store alltrim(lctext) to .ialist[1]
.numberofelements=lnarrlen+1
endif
* if alltrim(this.text)!=lctext
this.value=lctext
* endif
endif
endwith
set exact &lcexact
return

The combo box will see the new value in its list and display it. Otherwise, it just ignores it.

Luke
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform