المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Reply for ComboBox Sorting Alphabetically



C++ Programming
06-28-2010, 01:12 PM
Hi sir,
Thanks for all your help.I have found the solution.
I am reading all the character from combo and storing it in map.
then i am reading the character from combo and Find() in given whole map.
I am tryig this codeCString strValue;
CString strTemp;
m_CtrlComboID.GetWindowText(strValue);
std::map::iterator it=m_mapId.begin();
m_CtrlComboID.ResetContent();
for(; it!=m_mapId.end(); it++)
{
strTemp = it->first;
strValue.MakeUpper();
if(strTemp.Find(strValue)==0)
m_PatientID.AddString(strTemp);
}
m_CtrlComboID.SetWindowText(strValue);
m_CtrlComboID.ShowDropDown()the problem i am facing is,
1)The first string is getting set in the ComboBox.
2)when i type the first character in combo,it is getting the strings
related to the first character.
but i am not able to type in the second character,as the cursor is going in the first position.
The character which i have typed later is going first.
For Ex: First i will type the character as "P",
Second if i type "A" character in combo,its going before "P"
i.e "AP",but i need as "PA".
I am bit confused,
any suggestions


Thanks
Raj