Re: Combobox refresh
Posted: Sun Nov 20, 2016 12:59 pm
Thanks Theo !
Serge
Serge
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://www.hmgforum.com/
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
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