摘要: {文件路径+精确文件名+查找内容+是否替换+替换内容}function TForm22.SearchDir(const Dir, FileType, SearchText: string; IsReplace: boolean; const ReplaceText: string): boolean;var FS: TSearchRec; FPath: String;begin FPath := IncludeTrailingPathDelimiter(Dir); {返回APath:\} if FindFirst(FPath + '*.*', faAnyFile, FS) = 阅读全文
posted @ 2012-10-17 09:54 邹晟 阅读(229) 评论(0) 推荐(0) 编辑
摘要: procedure TForm22.selectDirClick(Sender: TObject);var dir: String;begin SelectDirectory('Select Search Directory','',dir); {得到目录路径+目录名} if dir <> '' then begin cbSearchDir.Text := IncludeTrailingPathDelimiter(dir); //如果Dir最后一个字符不是'\',加上一个'\'表示路径 end;end; 阅读全文
posted @ 2012-10-17 09:46 邹晟 阅读(165) 评论(0) 推荐(0) 编辑
摘要: procedure TForm26.CheckBoxClick(Sender: TObject); //当你点击chcekBox的时候,会自动改变CheckBox.Checked的值,这是点击操作begin ShowListView(CheckBox.Checked);end; 阅读全文
posted @ 2012-10-17 09:33 邹晟 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Function TForm26.ShowListView(IsCheck: Boolean): Boolean; //通过判定IsCheck,确定是否将第一行放置到Columns列位置var I, J, M: Integer; Titem: Tlistitem;begin listView1.Columns.Clear; listView1.Items.Clear; with ListView1 do begin for M := 0 to col - 1 do begin Columns.Add; Columns.Items[M].Width := 100; Columns.Items[M 阅读全文
posted @ 2012-10-17 09:25 邹晟 阅读(253) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2012-10-15 23:13 邹晟 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 一、图标的获取 要使用动态图标,首先要解决的是如何获得显示文本和与其相关联的图标句柄。该图标通过文件关联由系统注册表决定,并且在Windows编程中同一文件 (或子目录,或文件夹)在桌面上也可能有两种显示结果,这就是DOS文件名与显示名(Display Name)。如果我们的应用程序不需要有像Windows资源浏览器那样的效果,则可以使用FindFirst()和FindNext()二个函数以及 FindClose()过程来获得DOS文件名,否则我们就应当使用WindowsAPI来获得显示名。在获得文件名的同时可通过使用 ShellAPI.pas中的SHGetFileInfo()函数来获得其图标 阅读全文
posted @ 2012-10-15 22:20 邹晟 阅读(1883) 评论(0) 推荐(0) 编辑
摘要: ProgressBar1.Parent := StatusBar1; //加载ProgressBar到状态栏 ProgressBar1.Top := 2; //设置位置 ProgressBar1.Left := StatusBar1.Width div 2 + 1; var fileNum: Integer;begin StatusBar1.Panels.add; ProgressBar1.Position := 0; ProgressBar1.Max := fileNum; ProgressBar1.Position := 0; ProgressBar1.Posi... 阅读全文
posted @ 2012-10-15 22:14 邹晟 阅读(445) 评论(0) 推荐(0) 编辑
摘要: procedure TForm22.FormCreate(Sender: TObject);var FileInfo: TSHFileInfo; ImageListHandle: THandle;begin ImageListHandle := SHGetFileInfo('C:\', //将小图标集句柄指给列表 0, FileInfo, SizeOf(FileInfo), SHGFI_SYSICONINDEX or SHGFI_SMALLICON); {取小图标} SendMessage(Listview1.Handle, LVM_SETIMAGELIST, LVSIL_SM 阅读全文
posted @ 2012-10-15 22:01 邹晟 阅读(325) 评论(0) 推荐(0) 编辑
摘要: StringGrid控件组件名称:StringGrid●固定行及固定列:StringGrid.FixedCols:=固定行之数;StringGrid.FixedRows:=固定列之数;StringGrid. FixedColor:=固定行列之颜色;StringGrid.Color:=资料区之颜色;●资料行列之宽高度:StringGrid.DefaultColWidth:=内定全部之宽度;StringGrid.DefaultRowHeight:=内定全部之高度;StringGrid.ColWidths[Index:Longint]:=某一行整行之宽度;StringGrid.RowHeights[ 阅读全文
posted @ 2012-10-15 21:50 邹晟 阅读(4123) 评论(0) 推荐(0) 编辑
摘要: Procedure TForm26.GetExcel;var ExcelApp: Variant; ExcelWorkbook: Variant; fileName: string;begin fileName := edExcelFileName.Text; ExcelWorksheet : Variant; try ExcelApp := CreateOleObject( 'Excel.Application' ); //创建Excel文件 Except Exit; End; ExcelApp.Visible :=false; try ExcelWorkbook := Ex 阅读全文
posted @ 2012-10-15 20:34 邹晟 阅读(160) 评论(0) 推荐(0) 编辑