procedure TfrmSf.cbJkrChange(Sender: TObject);
var
I, selSt: Integer;
substr: string;
begin
if FLastKey in [VK_CLEAR, VK_BACK, VK_DELETE] then begin //delete or
backspace
exit;
end;
for I := 0 to cbJkr.Items.Count - 1 do begin
substr := Copy(cbJkr.Text, 1, cbJkr.SelStart);
if pos(substr, cbJkr.Items) = 1 then begin //find
selSt := Length(substr);
cbJkr.Text := cbJkr.Items;
cbJkr.SelStart := selSt;
cbJkr.SelLength := Length(cbJkr.Text) - selSt;
break;
end;
end;
end;
procedure TfrmSf.cbJkrKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
FLastKey := Ord(Key);
end;