【发布时间】:2018-08-15 23:22:18
【问题描述】:
我的目标是更新TListBox 的ItemIndex,这样当以编程方式将项目添加到列表时,相应的行会在TListBox 上标出。
我试过了:
with MyLstBox do begin
ItemIndex := -1;
for ind := 0 to Pred (Items.Count) do
if InsertedString = Items [ind]) then begin
ItemIndex := Ind;
Break;
end;
end;
这段代码勾勒了刚刚插入的项目,但也保持了前一个插入项目的轮廓。
MultiSelect 设置为False,所以原则上只需要概述一项。
【问题讨论】:
标签: delphi listbox firemonkey delphi-10.2-tokyo