0
votes

I have just noticed a strange behavior of ComboBox component. I am using it in DropDownList style. If I click on it, it drops down the list of items, as usual. But then if I click on some other component on the form, the combobox will not let me leave it, unless I select one of the items. I thought of adding onmouseleave event, but in that case it would close even if I move mouse out of combobox area a little, which is undesirable. What I would like to see is combobox losing focus whenever i click somewhere outside of its area. Is that possible?

1
That's the normal behaviour; I suspect some of your own (or third-party) code prevents it.Ondrej Kelle
I also thought so, then I opened a new application. Put a TComboBox and TEdit on it. I changed ComboBox style to DropDownList, added several items to it, then run the application. Problems is still there. Whenever I click on the CB, it drops down, and then if i click on the edit, focus remains on combobox.Tofig Hasanov
I just did that in Delphi 6 (coz I didn't believe you) and it behaves as expected.Despatcher
It seems that this program behaves correctly on other computers. Probably there is some problem with my configuration. I still don't know what caused this behavior though.Tofig Hasanov

1 Answers

1
votes

Actually, I just did what you did: started a new application and threw ComboBox and TEdit. Ran the program. It drops down the list just as you said when you clicked on it. Also, when I clicked on the TEdit, the combobox closed automatically as expected. So, I don't know what is the problem with your program.