内容摘要:本文介绍Delphi基础开发的一些技巧
[DELPHI]网络邻居复制文件
uses shellapi;
copyfile(pchar('newfile.txt'),pchar('//computername/direction/targer.txt'),false);[DELPHI]产生鼠标拖动效果
通过MouseMove事件、DragOver事件、EndDrag事件实现,例如在PANEL上的LABEL:
var xpanel,ypanel,xlabel,ylabel:integer;
PANEL的MouseMove事件:xpanel:=x;ypanel:=y;
PANEL的DragOver 事件:xpanel:=x;ypanel:=y;
LABEL的MouseMove事件:xlabel:=x;ylabel:=y;
LABEL的EndDrag 事件:label.left:=xpanel-xlabel;label.top:=ypanel-ylabel;
[DELPHI]取得WINDOWS目录
uses shellapi;
var windir:array[0..255] of char;
getwindowsdirectory(windir,sizeof(windir));或者从注册表中读取,位置:
HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionSystemRoot键,取得如:C:WINDOWS
[DELPHI]在FORM或其他容器上画线
var x,y:array [0..50] of integer;
canvas.pen.color:=clred;
canvas.pen.style:=psDash;
form1.canvas.moveto(trunc(x[i]),trunc(y[i]));
form1.canvas.lineto(trunc(x[j]),trunc(y[j]));[DELPHI]字符串列表使用
var tips:tstringlist;
tips:=tstringlist.create;
tips.loadfromfile('filename.txt');
edit1.text:=tips[0];
tips.add('last line addition string');
tips.insert(1,'insert string at NO 2 line');
tips.savetofile('newfile.txt');
tips.free;[DELPHI]简单的剪贴板操作
责编:豆豆技术应用
点击搜索更多"Delphi"相关信息
正在加载评论...
- Photoshop制作梦幻水晶球
- Windows Vista五个没有兑现的承诺
- 惊艳!Ubuntu 7.10系统新功能评测
- PhotoShop文字特效 Photoshop动感光影字重现黑客帝国
- 鼠绘:用Photoshop打造阿尔卡特手机
- JAVA中的反射机制详解
- J2EE:web开发中的缓存问题的研究(一)
- web开发中的缓存问题的研究(二)
- JDK 1.5中实现面向对象形式的SQL语句
- JSP中的pageEncoding和contentType属性