📄 tcombobox控件添加表中的字段.txt
字号:
向Tcombobox控件添加表中的字段,并随着Tcombobox的改变而相应的查找记录:
table1.open;
combobox1.items.clear;
while not table1.eof do
begin
combobox1.items.add(table1.fieldbyname('图书编号').asstring);
table1.next;
end;
table1.first;//重新定位到第一条记录
combobox1.itemindex:=0//与table1中的记录同步
另外在combobox1的onchang事件中,应该写入改变选择时table1也随着相就改变的代码:
with table1 do
begin
setkey;
fieldbyname('图书编号').asstring:combobox1.items[combobox1.itemindex];
gotokey;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -