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
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




