Thanks Theo !
Serge
Combobox refresh
Moderator: Rathinagiri
- serge_girard
- Posts: 3167
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Combobox refresh
There's nothing you can do that can't be done...
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Combobox refresh
Thanks.
Why do you use asort() after the combobox refresh?
Why do you use asort() after the combobox refresh?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Combobox refresh
Rathi, it should be in front (because i like my Comboboxes sorted). Thanks for keeping me sharpRathinagiri wrote:Thanks.
Why do you use asort() after the combobox refresh?
Code: Select all
FUNCTION RefreshCombobox(cWindowName,cComboBoxName,aArrayName)
LOCAL nX
DoMethod(cWindowName,cComboBoxName,'DeleteAllItems')
aSort(aArrayName)
FOR nX = 1 TO LEN(aArrayName)
DoMethod(cWindowName,cComboBoxName,'AddItem',aArrayName[nX])
NEXT
Return
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Combobox refresh
There is already a feature in combobox - 'Sort' enabled. It is automatically sorted even if you enter in different order.
Just FYI.
Just FYI.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Combobox refresh
Thanks Rathi !
Re: Combobox refresh
Thank you, it worked.
trmpluym wrote:I created a small universal function for the refresh of a ComboBox with a one dimensional array source.
It is simple but maybe it can help some others
Code: Select all
FUNCTION RefreshCombobox(cWindowName,cComboBoxName,aArrayName) LOCAL nX DoMethod(cWindowName,cComboBoxName,'DeleteAllItems') FOR nX = 1 TO LEN(aArrayName) DoMethod(cWindowName,cComboBoxName,'AddItem',aArrayName[nX]) NEXT aSort(aArrayName) Return