这样实现,自己看吧:
procedure TForm1.ComboBox1Change(Sender: TObject);
var
thepchar:array[0..79]of char;
str
char;
thestring:string;
theindex:integer;
begin
thestring:=trim(ComboBox1.Text);
if thestring<>'' then
begin
str:=pchar(thestring);
strcopy(thepchar,str);
theindex:=sendmessage(Combobox1.Handle,lb_selectstring,-1,longint(@thepchar));
sendmessage(Combobox1.Handle,lb_settopindex,theindex,0);
end
else
begin
sendmessage(Combobox1.Handle,lb_setcursel,-1,0);
sendmessage(Combobox1.Handle,lb_settopindex,0,0);
end;
end;