Originally posted by: Anthony
I was trying to add code to do the following:
1. When start typing, show the drop down list, which is OK, but then my mouse pointer disappears.
2. On the drop down list select the first match, so i can then press enter to choose this item. At the moment you have to arrow down to select an item then press enter.
All help appreciated.
ReplyOriginally posted by: Andreas Gut
Unfortunately, SelectString function is not case-sensitive.
To overcome this problem it seems to be necessary to use
the good old C-library function strncmp:
<snipsnap>
CString strItem;
int i;
int nCount = GetCount();
for (i = 0; i < nCount; i++)
{
GetLBText(i, strItem);
if (me_strncmp(LPCTSTR(str),
LPCTSTR(strItem), nLength) == 0)
break;
}
if (i == nCount)
{
// no text selected, so restore what was there before
SetWindowText(str);
if (dwCurSel != CB_ERR)
//restore cursor postion
SetEditSel(dStart, dEnd);
}
else
SetCurSel(i);
<snipsnap>
ReplyOriginally posted by: Rhys Jenkins
Having implemented your code, and run a few examples, I'm pleased at the result, except that in a CBN_KILLFOCUS handler I test for the selected value, which results in a CB_ERR value.
I've got a cheap workaround where I add a member variable which I update with GetCurSel during the CBN_EDITUPDATE handler, and return in a Get method, but I'm sure this is not the correct way to go about it.
Cheers,
Rhys
Originally posted by: Andreas Brauwers
I tried to extend the Autocompletion-ComboBox like IE5 it does. But I am unable to subclass the EditControl in the new IE Control.
Can somebody help??
Originally posted by: Andrew Rolfe
Microsoft's new version of C++ (6.0) has a class named CComboBoxEx. This obviously causes problems when compiling due to a class redefinition.
I just renamed the the class CComboBoxExCM (for Chris ). Don't forget to rename the source files also.
Reply