07 2014 档案
摘要://res 字符串资源//rc 文件:StringTablebegin0 "AAAA"1 "BBBB"2 "CCCC"3 "DDDD"end//也可以这样写:StringTablebegin0,"AAAA"1,"BBBB"2,"CCCC"3,"DDDD"end//还可以这样写:StringTable{0,"AAAA"1,"BBBB"2,"CCCC"3,"DDDD&qu
阅读全文
摘要://文字在窗体上水平来回移动procedure TForm1.Timer1Timer(Sender: TObject);{ Timer1.Interval:=10;}beginif label1.Left+label1.Width>0 thenlabel1.Left:=label1.Left-2else label1.Left:=form1.Width;end;来自为知笔...
阅读全文
摘要:Edit
TEditCut
TEditCopy
TEditpaste
TEditSelectAll
TEditUndo
TEditDelete 编辑 剪切 复制 粘贴 全选 撤销 删除 关联在以下控件上功能有效
TMainMenu
TPopMenu
TToolBar 以下控件功能有效
TMemo
TEdit
...
阅读全文
摘要:CoolBar这个怎么弄没了像Windows这样的 procedure TForm1.Button1Click(Sender: TObject);
begin CoolBar1.FixedOrder:=True;
end; 来自为知笔记(Wiz)
阅读全文
摘要:(*
一般的清空combobox方法 combobox1.clear;
...
combobox9.clear;
*) procedure TForm1.Button1Click(Sender: TObject);
var i: integer;
begin for i:=0 to self.ComponentCount-1 do
begin if self.Compo...
阅读全文
摘要://垂直显示标签文本Label1.Caption:='垂'+#13+'直'+#13+'显'+#13+'示';//使用相同的方法,我们也可以制作垂直显示的提示(Hint):button1.Hint:='垂'+#13+'直'+#13+'显'+#13+'示';来自为知笔记(Wiz)
阅读全文
摘要://array应用 DayOfWeek星期几判断procedure TForm1.Button1Click(Sender: TObject);vardays:array[1..7] of string;todayIs:string;begindays[1] := '日 ';days[2] := '一 ';days[3] := '二 ';days[...
阅读全文
摘要:Project Recources...//1提取出资源procedure TForm1.Button1Click(Sender: TObject);begin with TResourceStream.Create(HInstance, 'SnapShot_EXE', RT_RCDATA) do begin SavetoFile('SnapShot.exe...
阅读全文
摘要://屏蔽右键菜单procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;var Handled: Boolean);beginwith Msg dobeginif not IsChild(WebBrowser1.Handle, hWnd) then Exit;Handled := (message= ...
阅读全文
摘要:网页放大 网页缩小 WebBrowser1.OleObject.Document.Body.Style.Zoom := 0.50;
缩放网页 Ctrl+中键↑ 放大 Ctrl+中键↓ 缩小 constOLECMDID_OPTICAL_ZOOM = 63;varZoomIn: OleVariant;beginZoomIn := 10;WebBro...
阅读全文
摘要:撤销 重做 -
复制 剪切 粘贴 删除 -
全选 不选 ///编辑
///撤销 WebBrowser1.ExecWB(OLECMDID_REDO ,1);
///重做 WebBrowser1.ExecWB(OLECMDID_UNDO ,1);
///-
///复制 WebBrowser1.ExecWB(OLECMDID_COPY,1);
///剪切...
阅读全文
摘要:打印
页面设置
打印预览
文档属性 //------------------------------------------------------------------------------procedure WB_Print();beginForm1.WebBrowser1.ExecWB(OLECMDID_PRINT,1);end;//---------------...
阅读全文
摘要:编辑模式 浏览模式 设置焦点
//在使用前需要Webbrowser已经浏览过一个网页 否则错误 uses MSHTML;
///获取Webbrowser编辑模式里面的内容procedure EditMode();begin(Form1.WebBrowser1.Document as IHTMLDocument2).designMode := 'on';end;//-----------...
阅读全文
摘要:///HTML组件///后面的字符串为这个控件的ID号///直线Line(WebBrowser1.Document as IHTMLDocument2).execCommand('InsertHorizontalRule', True, '');///按钮Button(WebBrowser1.Document as I...
阅读全文
摘要:超链接 /取消超链接
插入/取消 书签
插入图片
粘贴图上CTRL+v
截图
插入表情GIF WEB背景色
WEB背景图片 WebBrowser1.OleObject.document.getElementById('bgDiv').currentStyle.BackGroundImage WebBrowser1.OleObject.document.body.currentStyle...
阅读全文
摘要:delphi 保存网页MHTuses ADODB_TLB, CDO_TLB, ComObj,MSHTML;{$R *.dfm}{能把网页如 WWW.QQ.COM保存为一个单文件 .MHT但不能把一个 A.HTM保存为一个单文件 .MHT}procedure WB_SaveAs_MHT(WB: TWe...
阅读全文
摘要:设置/获取 字体属性 名称 大小 粗体 斜体 下划线 删除线 颜色1 颜色2 uses MSHTML; //设置 //------------------------------------------------------------------------------procedure WB_SetFontName();begi...
阅读全文
摘要:自动滚动到最底端scrollUses MSHTML;{$R *.dfm}varScrollPos: integer=0;procedure TForm1.Button1Click(Sender: TObject);begininc(ScrollPos, 10);if WebBrowser1.Document nil then(WebBrowser1.Document ...
阅读全文
摘要:保存网页. htmluses ActiveX;procedure TForm1.Button1Click(Sender: TObject);varpersist :IPersistfile;beginpersist := (webbrowser1.document as ipersistfile);persist.save('c:\a.html',false);end;proc...
阅读全文
摘要:TreeView节点拖拉操作1 //事先设置 TreeView1.DragMode= dmAutomatic; unitUnit1; interface uses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,ComCtrls; type TForm...
阅读全文
摘要://这个拖拽的感觉不对
unit Unit1;interfaceusesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,ComCtrls;typeTForm1 = class(TForm)TreeView1: TTreeView;procedure Tr...
阅读全文
摘要:function ItemExist(Text:string;TreeView:TTreeView):Boolean;var i: Integer;begin Result:=False; if (Trim(Text)'') then begin for i := 0 to TreeView.Items.Count-1 do if Trim(Text) = Trim(TreeV...
阅读全文
摘要:procedure TForm1.TreeView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var node: TTreeNode;
begin if Boolean(TreeView1.GetNodeAt(X,Y)) then begin node := TreeView1.GetNo...
阅读全文
摘要:procedure TForm1.TreeView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);var Node: TTreeNode;begin with TreeView1 do begin Node := GetNodeAt(X, Y); ShowHint := (Node nil); ...
阅读全文
摘要:添加项目
TreeView1.Items.Add(nil,'ABC'); 删除选中的节点
TreeView1.Selected.Delete; 删除鼠标右键选中的节点 var node1:TTreeNode; procedureTForm1.TreeView1MouseMove(Sender:TObject;Shift:TShiftState;X, Y...
阅读全文
摘要:如何防止ListView控件闪烁
beginupdate()和endupdate()之间写代码 ListView1.Items.BeginUpdate;ListView1.Items.Add('AAA');ListView1.Items.EndUpdate; 来自为知笔记(Wiz)
阅读全文
摘要://TListView列表拒绝添加重复信息
procedure TForm1.Button1Click(Sender: TObject);vari: Integer;beginif (Trim(Edit1.Text)'') thenbeginfor i := 0 to ListView1.Items.Count-1 doif Trim(Edit1.Te...
阅读全文
摘要:ListView往TreView里面拖拽 unitUnit1; interface uses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,ComCtrls; type TForm1=class(TForm) TreeView1:T...
阅读全文
摘要:ListView添加项目带序列 function AddSelItems(listview1:TListView;ListView2:TListView):Boolean;vars: string;I,j: Integer;beginResult:=False;if listview1.Selected =nil thenexit;for i := 0 ...
阅读全文
摘要://ListView删除选中的多项目function DeleteMultSelItems(ListView:TListView):Boolean;varI: Integer;beginResult:=False;if ListView.Selected =nil then Exit;for i := ListView.items.count-1 downto0 d...
阅读全文
摘要:有问题
//ListBox选中的项目移动到第1位 Listbox1.Items.Move(ListBox1.ItemIndex,0); //ListView选中的项目移动到第1位 procedure TForm1.Button5Click(Sender: TObject);varsel:String;beginwith ListView...
阅读全文
摘要:ListView返回选中的多项目 procedure TForm1.Button3Click(Sender: TObject);vars: string;I: Integer;beginfor i := 0 to listview1.items.count - 1 dobeginif listview1.items[i].selected then...
阅读全文
摘要:unitUnit1; interface uses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,ComCtrls,StdCtrls; type TForm1=class(TForm) ListView1:TListView; ...
阅读全文
摘要:为TListBox添加水平滚动条
实例说明
TListBox组件是一个较为常用的列表组件,在默认情况下该组件是没有水平滚动条的,所以文字过长会显示不完全,在文字较短的情况下还可以,但是如果一行的文字很长的话也不行。本例为TListBox添加了一个水平的滚动条,运行本程序单击【添加滚动条】按钮在TListBox组件中就会增加一个水平滚动条,运行效果如图1所示。 图1 为TListBox...
阅读全文
摘要:ComboBox1.Perform(CB_SETDROPPEDWIDTH, 200, 0); 下拉高度
ComboBox1.DropDownCount:=20; {$externalsym cb_geteditsel}cb_geteditsel= $0140;{$externalsym cb_limittext...
阅读全文
摘要://返回ListBox选中的多项目 procedure TForm1.Button2Click(Sender: TObject);vari:Integer;s:string;beginfor i:=0 to ListBox1.Items.Count-1 doif ListBox1.Selected[i] thens:=s+ListBox1.Items[i]+#...
阅读全文
摘要://动态创建组件TEditprocedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);varEdit:TEdit;beginEdit:=Tedit.Create(nil);Edit.parent :=Self;Edit.Show...
阅读全文
摘要://限制字符的输入{ 只能输入以下字符 }procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin If (Key in ['\', '/', ':', '*', '?', '', '|']) then Key := #0; If not(Key in ['0' .. '9', 'a' .. 'z', 'A...
阅读全文
摘要:停留在窗体下面 处于
force my form to stay on the bottom?unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs;typeTForm1 = class(TForm)private...
阅读全文
摘要:VCL BitMap Style Proceject Options->Application->Appearance
选择几个样式
使用代码设置 uses Vcl.Themes;procedure TForm1.Button1Click(Sender: TObject);beginTStyleManager.TrySetStyle('Amakrits');end; ...
阅读全文
摘要:delphi 判断是否出现滚动条 if (GetWindowlong(Stringgrid1.Handle, GWL_STYLE) and WS_VSCROLL) 0 then ShowMessage('Vertical scrollbar is visible!'); if (GetWindowlong(Stringgrid1.Handle, GWL_STYLE) ...
阅读全文
摘要:在运行时移动控件 procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);constSC_DragMove = $F012;beginBeginReleaseCapture;Button1.pe...
阅读全文
摘要://function GetUser: string; //获取本机当前用户名varBuffer: array[0..255] of Char;Size: cardinal;beginSize := 256;if GetUserName(Buffer, Size) thenbeginResult := BufferendelsebeginResul...
阅读全文
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ShellAPI;type TForm1 = class(TForm) Memo1: TMemo; procedure FormCreate(S...
阅读全文
摘要:(*功能:IniFormState1 保存和读取 窗体的大小2 保存和读取 窗体在屏幕上的位置//让程序第1次出现在屏幕的中心点获取屏幕的中心点POSITION:poScreenCenter //不行*)//implementation//{$R *.dfm}uses IniFiles;//引用IniFiles///写入信息到ini文件 procedureWriteformStat...
阅读全文
摘要:EDIT Ini写Ini配置
usesIniFiles; {$R*.dfm} function IniFileName:string;
begin Result:=ExtractFilePath(Application.ExeName)+'Settings.ini';
end;
procedureSaveConfig(Edit:TEdit); beginwithTI...
阅读全文
摘要:效果不正确unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Bu...
阅读全文
摘要://这样就是左键单击mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );// 按下mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );//弹起//这样就是双击了!mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );// 按下mouse_event( MOU...
阅读全文
摘要:模拟TAB键 (2013/6/7 22:35:29)SelectNext(ActiveControl,True,True); 屏蔽Alt+F4关闭键 (2013/6/7 22:35:39)启动某些程序,使用Alt+F4键,可以快速的退出程序,可是如果是做一个屏幕保护程序的话,那么这个方便将成为绊脚石,所以有必要令该功能键失去作用,所以我们使用了窗体的OnKeyDown事件来检测击键:proced...
阅读全文
摘要:unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, AppEvnts, ComCtrls;typeTForm1 = class(TForm)StatusBar1: TStatusBar;Applicatio...
阅读全文
摘要:将窗体资源分装到DLL中并且调用用Delphi生成DLL并封装窗体的示例调用Dll里面的窗体
DLL文件 library Project2;{ Important note about DLL memory management: ...
阅读全文
摘要:unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;//定义类型要与原函数一样function GetUserDefaultUILanguage():Integer;external 'Ke...
阅读全文
摘要:Dll的创建与调用 File ->New->Other->Dll Wizard
DLL的创建
//可以将本代码复制粘贴到项目中
library Project1; uses SysUtils, Classes, Windows, Forms; {$R *.res} function Min(x,y:Integer):Integer;stdcall;
begin i...
阅读全文
摘要://刷新系统桌面
//方法1 uses ShlObj; SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil); -------------------------------------------------------------------------------- //方法2 SendMessage(FindWindow(...
阅读全文
摘要:{turn monitor off}SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 2); //关闭显示器{turn monitor on}SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, -1);
来自为知笔记(Wiz)
阅读全文
摘要:C:\Users\ADMINI~1\AppData\Local\Temp\ //GetTempPath获得临时文件目录(Temp文件夹) function TempPath:String;vartmp:array [0..MAX_PATH] of Char;beginGetTempPath(MAX_PATH,tmp);Result:= tmp;end; proc...
阅读全文
摘要://关闭计算器 procedure TForm1.Button1Click(Sender: TObject); var HWndCalculator: HWnd; begin HWndCalculator := FindWindow(nil, '计算器'); // 查找计算器句柄 if HWndCalculator 0 then SendMessage(HW...
阅读全文
摘要:var s:string='aaa'; s1:string; procedureTForm1.Button1Click(Sender:TObject); begin s1:=Format('确定要删除%s这个文件夹吗?',[s]); ifApplication.MessageBox(PAnsiChar(s1),'提示',MB_YESNO...
阅读全文
摘要:保存Image1图片 procedure TForm2.Button1Click(Sender: TObject);beginwith TSaveDialog.Create(nil) dobeginFilter:='JPEG file(*.jpg;*.jpeg)|*.jpg;*.jpeg|PNG file(*.png)|*.png|Bit...
阅读全文
摘要:捕捉整个桌面的图片 但不捕捉自己这个窗体 procedure TForm2.Button3Click(Sender: TObject);varBitmap: Tbitmap;BitmapCanvas: TCanvas;dc: HDC;DeskTopWidth,DeskTopHeight:Integer;beginDeskTopWidth:= Screen.Widt...
阅读全文
摘要://Canvas 在Image控件中绘制文字procedure TForm1.Button1Click(Sender: TObject);beginimage1.Canvas.Font.Size:= 72; //设置文字大小image1.Canvas.TextOut(1,1,'Delphi'); //输出文字end;来自为知笔记(Wiz)
阅读全文
摘要://Canvas绘图Canvas方法 CDC方法 功能Arc Arc 画一个椭圆弧Chord Chord 画一根玄。CopyRect 拷贝指定矩形区域中图象到指定矩形Draw BitBlt 拷贝位图Ellipse Ellipse 画椭圆FillRect PaintRgn 使用刷子填充一个又一个矩型FloodFill FloodFill 用当前刷子填充区域FrameRect Fr...
阅读全文
摘要:如何背景透明 unit Unit1;interfaceusesWinapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls;typ...
阅读全文
摘要:http://stackoverflow.com/questions/11459568/issue-with-rebuilding-and-saving-gifs-using-tgifimage 将图片序列如 01.jpg 02.jpg 03.jpg... 保存GIF是什么原理 多个JPG文件 合并成一个GIF文件 写入uses Vcl.Imaging.GIFImg, Vcl.Imaging.p...
阅读全文
摘要:拷贝剪贴板图像到窗体 procedureTBitmap.LoadFromClipboardFormat(AFormat:Word;AData:THandle;APalette:HPALETTE);
uses Clipbrd;
procedureTForm1.Button1Click(Sender:TObject); var Bmp:TBitmap; begin...
阅读全文
摘要:uses pngimage;{显示 png 图片}procedure TForm1.Button2Click(Sender: TObject);varpng: TPngImage;beginpng := TPngImage.Create;png.LoadFromFile('C:\Temp\Test.png');Canvas.Draw(0, 0, png);png...
阅读全文
摘要:将图片转换成字符 delphi的*.dfm文件
mht的文件 //------------------------------------------------------------------------------ //jpg转换为txt字符串 //JpegToText('C:\1.jpg', 'C:\1.txt');functionJpegToText(jpgFileN...
阅读全文
摘要:// 复制图片的一部分procedure TForm1.Button1Click(Sender: TObject);varBitmap: TBitmap;MyRect: TRect;beginMyRect := Rect(10,10,100,100);//定义复制范围Bitmap := TBitmap.Create; //生成Bitmap对象Bitmap.Load...
阅读全文
摘要:function ReverseString(s: string): string;var i: integer; s1:string;begin s1 := ''; for i := 1 to Length(s) do s1 := s[i] + s1; Result:=s1;end;procedure TForm1.Button1Click(Sender: TObject);be...
阅读全文
摘要:uses ActiveX;
procedure TForm1.BtnNewClick(Sender: TObject);var ID: TGUID; S: string;begin if CoCreateGuid (Id) = s_OK then begin s := GUIDToString (Id); Memo1.Lines.Add (S); end;end;
来自...
阅读全文
摘要://获得汉字字符个数function ChineseWordsCount(text:string):Integer;var i,sum,e,c,t: Integer;begin Result:=0; c := 0; sum := Length(text); if Sum=0 then exit; for i := 0 to sum do begin if Ord(text[...
阅读全文
摘要:随机字符串生成functionTfrmPWGenerate.btnGenerateClick(Sender: TObject):string;{max length of generated password}constintMAX_PW_LEN=10;vari: Byte;s:string;begin{if you want to use the 'A..Z' ch...
阅读全文
摘要:判断字符串是否一样.TXT .txt .TxT 为一样的SameTextCompareStrfunctionSameText(constS1, S2:string): Boolean; ifSameText('.txt','.tXT')then ShowMessage('Same'); 来自为知笔记(Wiz)
阅读全文
摘要://将edit1中的每个字符串改为首字母大写procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);beginwith Sender as Tedit doif (text = '') or (text[selstart] = ' ') or ( sellength = length( text ) ...
阅读全文
摘要:把7za.exe 复制到 C:\Windows\System32下面 按时间命名备份 备份前 请退出WIZ C:\Users\Administrator\Desktop\7za.exe a C:\Users\Administrator\Desktop\abc.7z C:\Users\Administrator\Desktop\test set m...
阅读全文
摘要:7za.exe x-aoa完美国际补丁.7z7za.exe x -aoa 完美国际补丁.7z -o"C:\Users\Admin\AppData\Local\Temp\完美国际补丁"来自为知笔记(Wiz)
阅读全文
摘要:procedure TForm1.FormShow(Sender: TObject);begin ShowWindow(Application.handle, SW_HIDE); SetWindowLong(Self.handle, GWL_EXSTYLE, GetWindowLong(Self.handle, GWL_EXSTYLE) ); // 不在alt+tab中出现end;来自为...
阅读全文
摘要:对文件和文件夹都有效FileSetAttr('D:\Administrator\Desktop\patcher\Win32\Release\config\element\update',faHidden);声明:function FileSetAttr ( const FileName : string; Attributes : Integer ) : Integer;描述:FileSetA...
阅读全文
摘要:procedure TForm1.FormCreate(Sender: TObject);begin Label1.AutoSize := False; Label1.WordWrap := True; Label1.Text := 'This is my caption that I would like to be wrappedThis is my caption ...
阅读全文
摘要://MmSystem播放Wav格式声音//MmSystem 支持 *.wav声音格式 snd ->SoundRecorderuses MmSystem; //引用MmSystem//播放系统声音{.Default //这个只要是字符串('str')就好MailBeepSystemExclamationSystemExitSystemHand}PlaySound ('SystemExit',0,...
阅读全文
摘要:uses shlobj;function GetDesktopFolder():string;var pItem: PItemIDList; temp: array[0..MAX_PATH] of Char;begin SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, pItem); //CSIDL_DESKTOP:桌面; FillChar(temp...
阅读全文
摘要:关键点
控制滚动条在最下面 实现过程 SendMessage(form1.Memo1.Handle,WM_VSCROLL,SB_BOTTOM,0); 图 备注 相关链接 来自为知笔记(Wiz)
阅读全文
摘要:procedure TForm1.Button1Click(Sender: TObject);Var OSVI:OSVERSIONINFO;begin OSVI.dwOSversioninfoSize:=Sizeof(OSVERSIONINFO); GetVersionEx(OSVI); Caption:=IntToStr(OSVI.dwMinorVersion)+','...
阅读全文
摘要:program Manager;uses Forms,Windows,Messages, Unit1 in 'Unit1.pas' {WMGJ_SERVERFORM1}, Unit2 in 'Unit2.pas' {Form2}, Unit3 in 'Unit3.pas' {Form3}, Unit4 in 'Unit4.pas' {Form4};{$R *.res}var AppT...
阅读全文
摘要:{ 1 h=1*60 m=1*60*60 s=1*60*60*1000 hs=3600000hs}function StartCount():string;{$j+}consth:Integer=0;m:Integer=0;s:integer=0;{$j-}begininc(s);if s>=60 thenbeginInc(m);...
阅读全文
摘要:procedure TForm1.FormCreate(Sender: TObject);beginedtHour.Clear;edtMinutes.Clear;edtHs.Clear;edtSec.Clear;end;procedure TForm1.Button1Click(Sender: TObject);begintryif edtHou...
阅读全文
摘要://判断文件是否正在被使用function FileINUse(filename:String):boolean;varusein:file;beginresult:=false;assignfile(usein,FileName);tryreset(Usein);excepton E:EInOutError dobeginif e.Er...
阅读全文
摘要:step1 在窗体上打个矩形的洞{鼠标可以穿透这个窗体}procedure MakeRectHole(Ctrl:TWinControl;Form:TForm);var Rgn1, Rgn2: HRGN;begin Rgn1 := CreateRectRgn(0,0, Form.Width, Form.Height); Rgn2 := CreateRectRgn(Ctrl.Left, Ctrl...
阅读全文
摘要:遍历目录及子目录 unitUnit1; interface uses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,StdCtrls; type TForm1=class(TForm) Memo1:TMemo; Button1:...
阅读全文
摘要: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 = clas...
阅读全文
摘要:添加项目 procedure TForm1.Button1Click(Sender: TObject);beginwith listview1.Items dobeginAdd.Caption:='1111111';Add.Caption:='2111111';Add.Caption:='3111111';end;end; ...
阅读全文
摘要://获取一个文件夹下的所有文件
//不包括文件夹里面的文件
//ListBox1.Items:=searchfile('Z:\'); //注意,path后面要有'\'; functionSearchfile(path:string):TStringList; var SearchRec:TSearchRec; found:integer; begin Result:=T...
阅读全文
摘要:Delphi连接MySQL真麻烦,研究了一天,从网上找了无数文章,下载了无数插件都没解决。最后返璞归真,老老实实用ADO来连接,发现也不是很顺利,但最终还是连接成功了。多少有点心得:ADO各个组件的作用和联系必须清楚,否则设置起来很容易混乱。总结一下用ADO连接MySQL5.1要点:1、需要下载MySQL的ODBC支持,我用的官网mysql-connector-odbc-5.1.7-win32.m...
阅读全文
摘要:TransparentColor:=true; TransparentColorValue:=clFuchsia; Color:= TransparentColorValue; BorderStyle:=bsNone;delphi 窗体透明http://hi.baidu.com/duduppp/item/f347df3a16dbb9607c034bd5来自为知笔记(Wiz...
阅读全文
摘要:unit untCpuInfo;interface{ 获取 CPU 制造商 }function GetCpuFactory: String;{ 获取 CPU 家族系统 }function GetCpuFamily: Cardinal;{ 获取 CPU 型号 }function GetCpuModel: Cardinal;{ 获取 CPU 步进 }function GetCpuStepping: C...
阅读全文
摘要://Canvas.TextOut文字保存为图片//Delphi开发案例精选,使用TextOut在画布上画图procedure TForm1.Button1Click(Sender: TObject);varMy_Image:Timage;i:integer;begintryMy_Image:=Timage.Create(nil);My_Image.Width:=me...
阅读全文
摘要:uses Jpeg;function BMPtoJPG(var BMPpic, JPGpic: string): boolean;var Bitmap: TBitmap; JpegImg: TJpegImage;begin result := False; Bitmap := TBitmap.Create; try Bitmap.LoadFromFile(BMPpic); J...
阅读全文
摘要:http://files.cnblogs.com/xe2011/officetable.rar画表格防OFFICE的功能画表格的功能usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.D...
阅读全文
摘要:链接:https://github.com/450640526/HtmExplorer最低环境系统安装了.NET 4.0地址:http://www.baidu.com/s?word=.NET+4.0&tn=82013038_35_hao_pg&ie=utf-8浏览器的版本最低 IE9.0否则网页中的...
阅读全文
摘要:新建HTML文档动态创建5个按钮 for (int i = 0; i < 5; i++) { Button button = new Button(); button.Location = new Point(button.Width *i, 10); //button.Click += new E...
阅读全文
摘要:编译一次自动更新版本号http://blog.csdn.net/gqqnb/article/details/7213611 安装与运行复制IncBuildNo.exe到你的硬盘,例如 C:\windows\IncBuildNo.exe 在Visual Studio中打开任意一个项目或解决方案,...
阅读全文
摘要:/*2014年7月8日19:56:45*/namespaceSystem.Windows.Forms{usingSystem;usingSystem.Drawing;publicpartialclassSearchBox:UserControl{publicSearchBox(){InitializeComponent();}publicnewstringText{get{returntextBo...
阅读全文
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.IO;namespace文件名{publ...
阅读全文
摘要:附件:http://files.cnblogs.com/xe2011/Webbrowser_Document_IsModified.rar该文档已被修改,是否保存修改结果?是:保存修改结果否:放弃修改结果取消:仍打开该文档触发这个对话框方法初始化 privatevoidForm1_Load(ob...
阅读全文