随笔分类 - Delphi
摘要:DELPHI TreeView 文件目录树和 设置节点图标 下载地址 http://download.csdn.net/detail/teststudio/6448293 需要制作文档管理软件 这个非常有用的 <!--more--> 1 文件夹 设置图标为 2 文件夹里没有文件的文件夹 设置图标为
阅读全文
摘要:procedure TForm1.Button1Click(Sender: TObject);var Dir, FileTitle, FileExt: string; s,s1: string; j:Integer;begin Dir := 'C:\'; FileTitle := '新建 文本文档'; FileExt := '.txt'; s1:=Dir+FileTitle+FileExt; j:=2; if FileExists(s1) then //C:\新建 文本文档.txt begin s:=Format('%s%s(%d)%s&
阅读全文
摘要:unit Unit1;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); proc...
阅读全文
摘要:Windows记事本记事本描述:用Delphi模仿的Windows记事本 界面和功能都和Windows的记事本一样,是用Memo实现的而不是RichEdit可以执行以下功能 文件 打开,保存,打印, 页面设置,撤销,复制,粘贴,查找,替换,插入时间日期,转到行,保存窗体大小 位置 和读取配置信息支持拖拽文件到记事本中...下载地址:http://download.csdn.net/detail/teststudio/6414215难点 对文件的新建 打开 保存 另存 退出文件件是否保存的判断 TMemo的打印和页面设置TMemo的文字查找和替换Memo的常用属性 property A...
阅读全文
摘要:加入Printers单元,varLeft,Top,PageHeight,i,x,y,LineSpace : integer;beginTop := 20;Left := 20;y := Top;//Top 起始行的位置,比如设置 Top := 20;x := Left;//Left 左边的起始位置,比如设置:Left := 20;PageHeight := 2600;//A4得纸张大概是这么多,我既不太清,你可以通过某个过程先得到这个数据,LineSpace := 24;//行间距Printer.BeginDoc;for i := 0 to Memo1.Lines.Count - 1 dobe
阅读全文
摘要:Delphi 打印Memo里面的内容 实现的功能和记事本的打印的功能一样打印保存为文件时此时的文件名如何设置?当Memo里的文本数量巨大时 窗体正在打印会出现点数字显示问题 闪烁PageSetup没做任何功能unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;typeTForm1 = class(TForm)Memo1: TMemo;Button1: TButton;PrinterSetupDialog1: TPri
阅读全文
摘要:Delphi Memo的记事本功能下载地址 : http://download.csdn.net/detail/teststudio/6412883这个代码实现了Windows记事本的主要功能。新建,打开,保存,另存,退出。文件拖拽打开文件 这主要是判断Memo内容是否修改过unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialog...
阅读全文
摘要:Delphi TFindDialog TReplaceDialog对话框的使用下载地址1: http://download.csdn.net/detail/teststudio/6408383下面这段代码已经完全的解决Memo的查找对话框 和 替换对话框功能 的所有功能查找对话框部件 查找对话框部件为应用程序提供查找对话框,用户可使用查找对话框在文本文件中查找字符串。 可用Execult方法显示查找对话框,如图4.8。应用程序要查找的字符放到FindText属性中。Options 属性可决定查找对话框中有哪些选项。例如,用户可选择是否显示匹配检查框。Options的常用选项如表4.2所示。..
阅读全文
摘要:Delphi Format中的换行符号是什么vars,s1,s2,s3:string;begins:='Hello';s1:=' World';s2:=format('%s%s%s',[s,#13#10,s1]);s3:=Format('%s'#13#10'%s',[s,s1]);ShowMessage(s2);ShowMessage(s3);end;#13#10两边都是有单引号的#13#10在这里不能用\n无效ShowMessage( Format('%s,%s,%s',['hello
阅读全文
摘要:源码地址 :http://450640526.ys168.com/编辑器是WEBBWOSER制作的 你的Internet Explorer的版本至少要是8.0的否则用不了还有很多BUG 很多功能没有完成Delphi版本:Delphi XE4 update1来自为知笔记(Wiz)
阅读全文
摘要://转换 TColor 到 HTML 颜色串 function ColorToHtml(color:TColor):string; var RgbColor : TColorRef; begin RgbColor := ColorToRGB(color); Result:=Format('#%.2x
阅读全文
摘要:Delphi QQ表情的实现QQ表情描述蓝框提示信息鼠标在这个表情上面 这个表情才动可以增加表情表情打包单击这个表情插入表情 关闭本窗体 主要使用Webbrowsr来实现的--------------------------------------------------------------------------------//调用过程unit Unit1;interfaceusesWinapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,Vcl.Cont
阅读全文
摘要:Delphi WebBrowser控件的使用 WebBrowser控件属性:1、Application 如果该对象有效,则返回掌管WebBrowser控件的应用程序实现的自动化对象(IDispatch)。如果在宿主对象中自动化对象无效,程序将返回WebBrowser控件的自动化对象2、Parent
阅读全文
摘要:{ 1 h=1*60 m=1*60*60 s=1*60*60*1000 hs=3600000hs}{时间 计时器 00:01:14}//label1.Caption:= StartCount();function StartCount():string;{$j+}consth:Integer=0;m:Integer=0;s:integer=0;{$j-}begininc(s);if s>=60 thenbeginInc(m);s:=0;end;if m>=60 thenbeginInc(h);m:=0;end;Result:=Format('%.2d:%.2d:%.2d
阅读全文
摘要:{获得磁盘驱动器序列号} function Get_HD_Serial(const Drivedir: Char): string; var Nu: DWORD; Vf: DWORD; VolumeInfo: array[0..MAX_PATH] of Char; V_n: DWORD; begin
阅读全文
摘要:{得到系统C:\Windows\system32 路径}//调用Edit1.text:=getSys32Path();function getSys32Path():string;varsPath : PCHAR ;beginGetMem(sPath,255);GetSystemDirectory(sPath,255);Result := sPath;//C:\Windows\system32end;通过 为知笔记 发布
阅读全文
摘要:{GetDriveType} //调用GetDriveTypeA(Memo1); procedureGetDriveTypeA(Memo:TMemo); var i:Integer; C:String; DType:Integer; DriveString:String; begin //通过循环依次判断各盘符的类型 Memo.Clear; fori:=65to90do begin C:=chr(i)+':\'; DType:=GetDriveType(PChar(C)); caseDTypeof 0:DriveString:=C+'不能判断的驱动器类型.';
阅读全文
摘要:{获取本机当前用户名}//调用 返回值:= GetUser();function GetUserName(): string;varBuffer: array[0..255] of Char;Size: cardinal;beginSize := 256;if GetUserName(Buffer, Size) thenbeginResult := BufferendelsebeginResult := 'Unknown'end;end;{获取计算机名}//调用 返回值:= GetComputerName();function GetComputerName(): string
阅读全文
摘要:usesShellAPI;{打开网址}//调用Link('www.baidu.com'); procedureLink(URL:string); begin ShellExecute(Application.Handle,nil,PChar(URL),0,0,SW_SHOWNORMAL); end; 通过 为知笔记 发布
阅读全文
摘要:{取得汉字的第一个字母} //调用 edit1.text:=GetPYIndexChar('你')functionGetPYIndexChar(str:string):char; begin caseWORD(str[1])shl8+WORD(str[2])of $B0A1..$B0C4:result:='A'; $B0C5..$B2C0:result:='B'; $B2C1..$B4ED:result:='C'; $B4EE..$B6E9:result:='D'; $B6EA..$B7A1:result:=
阅读全文