您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

类似Access查找中的记忆功能

2025/2/22 3:40:33发布15次查看
procedure tcomlocatefrm.locatebtnclick(sender: tobject); var setlooptions : tlocateoptions; i : integer; slkeys : tstrings; begin if combobox1.items.indexof(combobox1.text)0 then try slkeys := tstringlist.create; slkeys.addstrings(combobox
procedure tcomlocatefrm.locatebtnclick(sender: tobject);
var
   setlooptions : tlocateoptions;
   i : integer;
   slkeys : tstrings;
begin
if combobox1.items.indexof(combobox1.text)  try
    slkeys := tstringlist.create;
    slkeys.addstrings(combobox1.items);
    combobox1.items.clear;
    combobox1.items.add(combobox1.text);
    for i := 0 to 8 do
      if i         combobox1.items.add(slkeys.strings[i]);
  finally
     slkeys.free;
  end
  else begin
    i := combobox1.items.indexof(combobox1.text);
    combobox1.items.insert(0,combobox1.text);
    combobox1.items.delete(i+1);
    combobox1.itemindex := 0;
  end;
  if rdoexactly.checked then
     setlooptions := []
  else
     setlooptions := [lopartialkey];
  if not desdataset.locate('ztm', combobox1.text, setlooptions) then
     messagebox(handle, '没有找到符合条件的记录。', '提示', 0+64);
end;
本文作者:
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product