DBLookupEh.pas 中修改代码:
procedure TCustomDBLookupComboboxEh.KeyPress(var Key: Char);
begin
if FListVisible and CharInSetEh(Key, #13, #27) then
begin
CloseUp(Key = #13);
Key := #0;
end;
inherited KeyPress(Key);
case Key of
#8:
if (Style = csDropDownListEh) then
begin
ProcessSearchStr(Key);
Key := #0;
end
else
begin
//加入代码
if DropDownBox.AutoDrop and not FListVisible and FListActive then DropDown;
if (Style = csDropDownListEh) then
begin
ProcessSearchStr(GetCompleteKeyPress);
Key := #0;
end;
end;
{#13:
begin
Key := #0;
FDataLink.UpdateRecord;
SelectAll;
end;}
#32..High(Char):
begin
if DropDownBox.AutoDrop and not FListVisible and FListActive then DropDown;
if (Style = csDropDownListEh) then
begin
ProcessSearchStr(GetCompleteKeyPress);
Key := #0;
end;
end;
end;
end;