Hi Paul,
I would like to add an empty string to a combobox as the first item so that one can undo the changes that one has made to a combobox. I tried to do this via the custom property of a combobox but this does nog work. Is this something related to the combobox itself or to FF.
Regards,
Marc
Is this what you are looking for?
'--------------------------------------------------------------------------------
FUNCTION FORM1_WM_CREATE ( _
hWndForm AS DWORD, _ ' handle of Form
BYVAL UserData AS LONG _ ' optional user defined Long value
) AS LONG
LOCAL lIndex AS LONG
'----------------------------------------
'Insert Item_00
lIndex = FF_ComboBox_AddString(HWND_FORM1_COMBO1, "")
FF_ComboBox_SetItemData(HWND_FORM1_COMBO1, lIndex, 0)
'Insert Item_01
lIndex = FF_ComboBox_AddString(HWND_FORM1_COMBO1, "Item_01")
FF_ComboBox_SetItemData(HWND_FORM1_COMBO1, lIndex, 1)
'Insert Item_02
lIndex = FF_ComboBox_AddString(HWND_FORM1_COMBO1, "Item_02")
FF_ComboBox_SetItemData(HWND_FORM1_COMBO1, lIndex, 2)
'select first item
FF_ComboBox_SetCurSel(HWND_FORM1_COMBO1, 0)
END FUNCTION
'--------------------------------------------------------------------------------
FUNCTION FORM1_COMBO1_CBN_SELCHANGE ( _
ControlIndex AS LONG, _ ' index in Control Array
hWndForm AS DWORD, _ ' handle of Form
hWndControl AS DWORD, _ ' handle of Control
idComboBox AS DWORD _ ' identifier of combobox
) AS LONG
MsgBox Str$(FF_ComboBox_GetCurSel(HWND_FORM1_COMBO1))
END FUNCTION
Rudolf Fuerstauer
Thx Rudolf. Did it that way.
Still, I have not been able to add an empty item in the (custom) property of the combobox.
Hi Marc,
I had the "Custom" editor coded not to allow null strings. I have now removed that restriction so blank strings can be used. Fix will be in the next update.
New EXE can be found at:
http://www.planetsquires.com/protect/forum/index.php?topic=3097.msg23133#msg23133
Thank you Paul.