该文被密码保护。 阅读全文
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) 编辑
摘要: var ComboBoxList: Array [1..44] of TComboBox; I, J: Integer;begin for I := 1 to row dobegin for J := 1 to col do begin ComboBoxList[J] := TComboBox.Create(self); //动态创建 ComboBoxList[J].Parent := GroupBox1; //或ScrollBox1、 self 显示在啥组件上或Form上 ComboBoxList[J].Width := 100; //组件宽度 if J = 1 then Comb... 阅读全文
posted @ 2012-10-15 20:11 邹晟 阅读(255) 评论(0) 推荐(0) 编辑
摘要: edDatabase.Text := PromptDataSource(Application.Handle, ''); 或 edDatabase.Text := PromptDataSource(Application.Handle, edDatabase.Text);上面的PromptDataSource函数调用系统的连接数据库操作页面,会弹出一个连接数据库页面,连接成功后,返回数据库路径,可选数据库名。procedure TForm26.btAddTableClick(Sender: TObject);var tbaleList: TStringList; fieldNa 阅读全文
posted @ 2012-10-15 20:02 邹晟 阅读(977) 评论(0) 推荐(0) 编辑
摘要: TNoteBook组件中有一个pages属性,是Tstrings类型。通过pages属性设置相应的页面。1。先通过Pages属性设置多个记录页面,以3个page为例(0, page0), (1, page1), (2, page2)2。右键点击TNoteBook组件名称NoteBook1,选择NextPage,会跳到下一个记录页面3。在记录页面上加Panel页面。这样就可以绑定Panel页面,有多少个记录页面,就可以绑定多少页面4。NoteBook1.PageIndex :=NoteBook1.PageIndex - 1 或 NoteBook1.PageIndex+ 1 移动。case Not 阅读全文
posted @ 2012-10-15 19:46 邹晟 阅读(410) 评论(0) 推荐(1) 编辑
摘要: opendialog1.InitialDir := ExtractFilePath(Application.ExeName); //设置打开初始路径,通过Application.ExeName运行程序得到程序路径if opendialog1.Execute then//运行TOpenDialog打开选择文件 begin if LowerCase(ExtractFileExt( opendialog1.FileName)) <> '.xls' then//选取文件的副类型,然后换成小写 begin opendialog1.FileName:= opendialog1. 阅读全文
posted @ 2012-10-15 19:34 邹晟 阅读(1227) 评论(0) 推荐(0) 编辑