TComboBox.AutoDropDown can lead to discrepant Text and ItemIndex values under win32
Original Reporter info from Mantis: luizamerico
-
Reporter name: Luiz Americo
Original Reporter info from Mantis: luizamerico
- Reporter name: Luiz Americo
Description:
Put a TComboBox with style csCombo and AutoDropDown = True
add the following items
aaa
bbb
ccc
open dropdown and select bbb -> Index = 1. OK
Close dropdown, unselect the text and put cursor at the end: bbb|
Type x: bbb will be erased and only x will appear. Item index still is 0
--
The problem occurs because win32 internally selects the text in the dropdown list as soon as the list is popped. Since at KeyDown (after type x) Text is still bbb, bbb is selected in the edit control. When x key is handled it will erase bbb and put x in place of it. The ItemIndex is not updated to reflect this and returns as if bbb is still the active text.
Mantis conversion info:
- Mantis ID: 20950
- Monitored by: » Lion (Lion)