How do I get the ItemValue (name) from a comboBox. I looked at the function FF_ComboBox_GetItemData I don't see where it returns the string value of the item.
Also, does this function actually SET text ? From the name I would have thought it would GET text? I'm confussed.
Function FF_ComboBox_GetItemData( ByVal hWndControl As Dword, _
ByVal nIndex As Long _
) As Long
' Do a check to ensure that this is actually a window handle
If IsWindow(hWndControl) Then
' Set the text and return the position where the text was added.
Function = SendMessage( hWndControl, %CB_GETITEMDATA, nIndex, 0)
Else
Function = %CB_ERR
End If
End Function
Two functions are needed. Use the Combobox GetText and it needs supplied the Combobox GetCurSel for the parameter to get the text from.
As for the other function, that is kind of like lparam data in Listviews, extra data you can store in an item, not the text. It looks commented wrong though...in looking at code for those, listboxes, and textboxes it looks like he copied/pasted when he made them and didn't change the comments.
You might use this:
strVal = FF_ComboBox_GetText( HWND_FORM1_COMBO1, _
FF_ComboBox_GetCurSel( HWND_FORM1_COMBO1 ) )
Roger & Rolf, Thank you.
I guess I was confussed. It seems so simple now.
Marty,
in German we have saying "Sometimes you do not see the forest because of all the trees!"
I tell you I sometime have a lot of trees around me.