请问当listbox的mutiselected属性为true时,当我选多项时,怎么样才能记录下来它的选择的起始位置和末位置?
解决方案 »
- published是什么意思?
- Delphi如何开发IE插件???最好有例子!!!
- 从SQL Server导出的数据怎样把数据类型,数据长度定位到TStringGrid的各列?
- 用注册表控制使用次数的问题。统计次数的整形变量怎么才能累计相加吖,在线,立刻给分
- 会者不难(关于sql)
- 救命啊,要死了……
- SaveDialog的一个问题
- 请问各位大侠帮小妹一把,急:快来帮手<< :)
- 如何用DELPHI进行团队开发呀,
- Delphi控件及Delphi & C/C++电子书籍下载网址。
- 可以生成一张表,它的每一列都是通过SELECT……from (other table)语句生成的吗?
- combox
procedure TForm1.Button1Click(Sender: TObject);
Var
i:integer;
begin
for i := 0 to (ListBox1.Items.Count - 1) do
begin
if ListBox1.Selected[i] then
showmessage(listbox1.Items.Strings[i]);
end;end;
var
i,first,last : integer;
begin
firstid := false;
lastid := false;
//起始
for i := 0 to listbox1.Items.Count -1 do
begin
if listbox1.Selected[i] then
begin
first := i;
break;
end;
end;
//结束
for i := listbox1.Items.Count -1 downto 0 do
begin
if listbox1.Selected[i] then
begin
last := i;
break;
end;
end;
showmessage(inttostr(first)+' '+inttostr(last));
end;
var
i,first,last : integer;
begin
//起始
for i := 0 to listbox1.Items.Count -1 do
begin
if listbox1.Selected[i] then
begin
first := i;
break;
end;
end;
//结束
for i := listbox1.Items.Count -1 downto 0 do
begin
if listbox1.Selected[i] then
begin
last := i;
break;
end;
end;
showmessage(inttostr(first)+' '+inttostr(last));
end;