help
-
philiptabraham wrote:
Can anybody tell me how to clear the combo box in the OnEditChange Function.
See here.
philiptabraham wrote:
i tried RESETCONTENT function within the OnEditChange Function.But it didnt work.
Why not? What happened? Be specific.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
when i give the function it is always getting reseted. ex:i need to retrieve all the values from the database starting with 'p'.So ill give 'p' in the comboBox and the Corresponding values loaded into the combobox.But latter if i want retrieve all the values from the database starting with 'po', then it is listing all the datas starting with 'p' and 'po'. What i have done is in the EditChangeFunction i am fetching the user entered value from the combobox say 'p' create the query and call the database function.The Result from the database are stord in an array and this array is loaded into the ComboBox Using AddString.
-
when i give the function it is always getting reseted. ex:i need to retrieve all the values from the database starting with 'p'.So ill give 'p' in the comboBox and the Corresponding values loaded into the combobox.But latter if i want retrieve all the values from the database starting with 'po', then it is listing all the datas starting with 'p' and 'po'. What i have done is in the EditChangeFunction i am fetching the user entered value from the combobox say 'p' create the query and call the database function.The Result from the database are stord in an array and this array is loaded into the ComboBox Using AddString.
philiptabraham wrote:
when i give the function it is always getting reseted.
Last time I checked, that is exactly what the
CB_RESETCONTENT
message is supposed to do.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
when i give the function it is always getting reseted. ex:i need to retrieve all the values from the database starting with 'p'.So ill give 'p' in the comboBox and the Corresponding values loaded into the combobox.But latter if i want retrieve all the values from the database starting with 'po', then it is listing all the datas starting with 'p' and 'po'. What i have done is in the EditChangeFunction i am fetching the user entered value from the combobox say 'p' create the query and call the database function.The Result from the database are stord in an array and this array is loaded into the ComboBox Using AddString.
-
philiptabraham wrote:
when i give the function it is always getting reseted.
Last time I checked, that is exactly what the
CB_RESETCONTENT
message is supposed to do.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
this is a sample code that i have done OnEditChange() { m_aa.AddString("xxx");//m_aa is the variable of my combobox of Type CComboBox m_aa.AddString("YYY"); m_aa.RESETCONTENT();//will not allow me to edit the comboBox ,it will get reset } whati nedd is ,whenever i make a change in the combobox only xxx and yyy should be displayed in the combobox list. what is happening now is whenever i make or edit the combobox the number of time the data displaying is doubled
-
this is a sample code that i have done OnEditChange() { m_aa.AddString("xxx");//m_aa is the variable of my combobox of Type CComboBox m_aa.AddString("YYY"); m_aa.RESETCONTENT();//will not allow me to edit the comboBox ,it will get reset } whati nedd is ,whenever i make a change in the combobox only xxx and yyy should be displayed in the combobox list. what is happening now is whenever i make or edit the combobox the number of time the data displaying is doubled
-
have you used combovariable.ResetContent(); before calling your query?
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.
what is happening is if i give restContent it will reset it after each character i enter in the combobox. For example if i type p the value is reseted where as i want to search a string for 'po'.
-
this is a sample code that i have done OnEditChange() { m_aa.AddString("xxx");//m_aa is the variable of my combobox of Type CComboBox m_aa.AddString("YYY"); m_aa.RESETCONTENT();//will not allow me to edit the comboBox ,it will get reset } whati nedd is ,whenever i make a change in the combobox only xxx and yyy should be displayed in the combobox list. what is happening now is whenever i make or edit the combobox the number of time the data displaying is doubled
I'd hazard a guess and say that you that you might need to remove old items from the combobox before adding new ones? ;)
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
have you used combovariable.ResetContent(); before calling your query?
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.
i need to retrieve all the values from the database starting with 'p'.So ill give 'p' in the comboBox and the Corresponding values loaded into the combobox.But latter if i want retrieve all the values from the database starting with 'po', then it is listing all the datas starting with 'p' and 'po'. if i give RESTCONTENT after writing p, it will get reseted. I wont be able to search for strings with 2 or 3 letters
-
I'd hazard a guess and say that you that you might need to remove old items from the combobox before adding new ones? ;)
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
i tried that also but its not getting it removed completely. what i tried is: On the second time before adding new string ill get the count and within the loop i tried to delete the string.But every thing is not getting deleted
-
i need to retrieve all the values from the database starting with 'p'.So ill give 'p' in the comboBox and the Corresponding values loaded into the combobox.But latter if i want retrieve all the values from the database starting with 'po', then it is listing all the datas starting with 'p' and 'po'. if i give RESTCONTENT after writing p, it will get reseted. I wont be able to search for strings with 2 or 3 letters
now i got your concept. you mean, you are dealing the on edit change event of the combo box it self. if so, do one thing. 1.first, before calling the query, preserve the string available in the combobox, in a temporarystring, by using getdlgitemtext(). 2.then reset your content. 3.then call your query and upload them into the combo using addstring. 4.then using setdlgitemtext set the temporary string to the dialog. but here, iam not sure about the cursor position. you have to check it out. lets see if any body suggests a better technique.
-
i tried that also but its not getting it removed completely. what i tried is: On the second time before adding new string ill get the count and within the loop i tried to delete the string.But every thing is not getting deleted
philiptabraham wrote:
On the second time before adding new string ill get the count and within the loop i tried to delete the string.But every thing is not getting deleted
Probably because you are removing from the top-down rather than from the bottom-up. Why are you not removing them all at once rather than one at a time?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
now i got your concept. you mean, you are dealing the on edit change event of the combo box it self. if so, do one thing. 1.first, before calling the query, preserve the string available in the combobox, in a temporarystring, by using getdlgitemtext(). 2.then reset your content. 3.then call your query and upload them into the combo using addstring. 4.then using setdlgitemtext set the temporary string to the dialog. but here, iam not sure about the cursor position. you have to check it out. lets see if any body suggests a better technique.
thank a lot...
-
thank a lot...
wait a minute!!! now what happened to your cursor position? and what about my suggestion?(see down):-D;)
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.