--返回选中项值
function GetLstBoxValue(LstBox: TListBox): String;
begin
Result:='';
Result:=LstBox.Items[LstBox.ItemIndex];
end;
--返回选中项节点
function GetLstBoxIndex(LstBox: TListBox): Integer;
begin
Result:=-1;
Result:=LstBox.ItemIndex;
end;

本文提供了两个实用的Delphi函数,用于从ListBox组件中获取选中项的值和索引。这些函数对于需要频繁处理ListBox选中状态的应用程序非常有用。
2166

被折叠的 条评论
为什么被折叠?



