LCL: ComboBox: Win32: Don't loose ItemIndex with AutoComplete set. Issue #32301

git-svn-id: branches/fixes_1_8@55706 -
This commit is contained in:
michl 2017-08-19 21:49:01 +00:00
parent a1d014b662
commit 8c4eda4980

View File

@ -1103,6 +1103,7 @@ class procedure TWin32WSCustomComboBox.SetDroppedDown(
var
aSelStart, aSelLength: Integer;
aText: string;
OldItemIndex: Integer;
begin
if WSCheckHandleAllocated(ACustomComboBox, 'TWin32WSCustomComboBox.SetDroppedDown') then
begin
@ -1111,7 +1112,9 @@ begin
aSelStart := GetSelStart(ACustomComboBox);
aSelLength := GetSelLength(ACustomComboBox);
OldItemIndex := GetItemIndex(ACustomComboBox);
SendMessage(ACustomComboBox.Handle, CB_SHOWDROPDOWN, WPARAM(ADroppedDown), 0);
SetItemIndex(ACustomComboBox, OldItemIndex);
SetText(ACustomComboBox, aText);
SetSelStart(ACustomComboBox, aSelStart);