你所说的问题按如下方法即可解决: //DBLkComb为TDBLookupComboBox's Name with DBLkComb do begin ListSource.DataSet.Locate(DBLkComb.KeyField,'value',[]) ; //Value可自已传个参数过来 DBLkComb.KeyValue:=ListSource.DataSet.FieldByName(DBLkComb.KeyField).Value ; end ;
with dblookupcombobox1 do begin listsource:=datasource1; listfield:='field1'; end;
with DBLkComb do begin
ListSource.DataSet.Locate(DBLkComb.KeyField,'value',[]) ;
//Value可自已传个参数过来
DBLkComb.KeyValue:=ListSource.DataSet.FieldByName(DBLkComb.KeyField).Value ;
end ;
begin
listsource:=datasource1;
listfield:='field1';
end;