PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → fill combobox with just created value on another form
fill combobox with just created value on another form
Débuté par Christine, 04 jan. 2005 17:35 - 3 réponses
Posté le 04 janvier 2005 - 17:35
I have a form that opens another form through open(form2).
In the form1 there is a combo box which contains countrycodes.
In the second form country can be created.
I add a button on the form1 that opens form2 (to create new countrys)
Is there a possibility to keep the value of the just created country when returning to form 1 (by closing form2).
With listdisplay on the "entry of the combobox" i see that the country is inserted into the combobox but i want it selected already.
So just want to know to keep the selected of created value of form2 when returning to form1
Posté le 05 janvier 2005 - 14:48
Why not make the form2 return a value (the new country) and then use listselectplus() to select that value, then listdisplay()
hth
Clive
Posté le 07 janvier 2005 - 11:43
Christine,
Make form2 return the countrycode and use listseek to select it in form1:
Button click code:
xCountryCode is string
i is int
xCountryCode=Open(Form2)
i=Listseek(cmbCountries,xCountryCode)
ListselectPlus(cmbCountries,i)
Regards,
Piet
Posté le 07 janvier 2005 - 11:49
Forgot to add the countrycode to the combo in form1 using Listadd:
xCountryCode is string
i is int
xCountryCode=Open(Form2)
ListAdd(cmbCountries,xCountryCode)
i=Listseek(cmbCountries,xCountryCode)
ListselectPlus(cmbCountries,i)
Regards,
Piet