手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>delphi>列表

List列表拖放排序记忆演示

来源:互联网 作者:west263.com 时间:2008-02-23
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

end;

{ 拖放时滚动ListView组件的函数 }
procedure TForm1.ListBox1DragOver(Sender, Source: TObject;
X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
{ Scroll Listview when Drag/Drop }
if Y<15 then SendMessage(ListBox1.Handle,WM_VSCROLL,SB_LINEUP,0)
else if ListBox1.Height-Y<15 then SendMessage(ListBox1.Handle,WM_VSCROLL,SB_LINEDOWN,0);
{ whether accept it }
if (Source is TListBox) and (ListBox1.Count>0) and
(ListBox1.ItemAtPos(Point(X,Y),True)<>ListBox1.ItemIndex) then
Accept:=True else Accept:=False;
end;

procedure TForm1.ListBox1KeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
if Key=46 then { Delete Key }
Button2.OnClick(Sender);
end;

procedure TForm1.FormShow(Sender: TObject);
begin
ListBox1.Clear;
LoadIniFile(ListBox1.Items);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
{得到程序路径}
Application_Path:=ExtractFilePath(ParamStr(0));
end;

end.

上一篇: 用Delphi控制Word的输出
下一篇: 学习控件编写,如何对指定的图片进行处理。

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!