我想实现的功能是当选中某一item时,点击向上,就使其顺序向上移动一下,直到顶部,点击向下就向下移动,直到底部。请求高手帮助,谢谢!
解决方案 »
- 当所有窗体都设为Available forms时,有多少种方法能选择启动Main form.
- 这个函数哪里错了,为什么在我的单元里不能使用????
- 赶快帮个忙啊,我的程序是用的Delphi6+Oracle10G开发,数据库访问用的是Ado,但现在才发现这样的话,客户端也需要安装Oracle的客户端,
- 问个txt文本输出的问题
- 有公司需要代码外包的请进
- 没有办法不给你mrfanghansheng(☆☆☆木鱼☆☆☆) 100不行
- 应聘时的经典回答,不知道大家看过没,我服了这家伙了
- 检查一个URL是否有效
- FileCreate的问题
- 读注册表,为什么没有结果??结果应该是www.csdn.net啊!!
- 如何音频输出设备切换
- counterhacker(cao.x.j)你理智点,不断骚扰我!我该怎么办,版主,大区版主我要个说法。
begin
i:=ListBox1.ItemIndex;
s:=ListBox1.Items.Strings[i];
ListBox1.Items.Delete(i);
ListBox1.Items.Insert(i-1,s);
end;
比较笨的方法.向下的也同样的道理就不写了.
procedure TForm1.Button1Click(Sender: TObject);
begin
if ListBox1.ItemIndex > 0 then
ListBox1.Items.Exchange(ListBox1.ItemIndex, ListBox1.ItemIndex - 1);
end;//向下
procedure TForm1.Button2Click(Sender: TObject);
begin
if ListBox1.ItemIndex < ListBox1.Items.Count - 1 then
ListBox1.Items.Exchange(ListBox1.ItemIndex, ListBox1.ItemIndex + 1);
end;
ListBox1.Selected[i-1]:=True;
procedure TSetComForm.Button6Click(Sender: TObject);
var
sindex:integer;
sstring:string;
begin
if listbox2.itemindex<> 0 then
begin
sstring:=listbox2.Items[listbox2.itemindex];
sindex:=listbox2.itemindex-1;
Listbox2.DeleteSelected;
listbox2.Items.Insert(sindex,sstring);
listbox2.ItemIndex:=sindex;
end;
end;procedure TSetComForm.Button7Click(Sender: TObject);
var
sindex:integer;
sstring:string;
begin
if listbox2.itemindex <> listbox2.Items.Count-1 then
begin
sstring:=listbox2.Items[listbox2.itemindex];
sindex:=listbox2.itemindex+1;
Listbox2.DeleteSelected;
listbox2.Items.Insert(sindex,sstring);
listbox2.ItemIndex:=sindex;
end;
end;
>>修改过某一个项目之后接着修改另一个项目,这就会造成上次修改的不起作用了,怎么做才能修改过所有项目之后一起保存?
这个不明白什么意思。