随笔分类 -  积累点点滴滴

自己遇到的小问题
摘要:var Edits: array [0..5] of TEdit; // 把所有的Edit当成是数组procedure TForm1.Button1Click(Sender: TObject);var i, j: integer;begin for i := 0 to ComponentCou... 阅读全文
posted @ 2016-01-08 19:30 王云盼 阅读(476) 评论(0) 推荐(0)
摘要:procedure TForm1.ToolButton1Click(Sender: TObject);begin Edit1 := TEdit.Create(Panel1); // 将panel放在Edit控件上,Panel属于Edit Edit1.Parent := self; ... 阅读全文
posted @ 2016-01-08 19:04 王云盼 阅读(203) 评论(0) 推荐(0)
摘要:procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);var i: Boolean;begin i := (keyChar #57) ; if ... 阅读全文
posted @ 2016-01-08 18:51 王云盼 阅读(645) 评论(0) 推荐(0)
摘要:procedure TForm1.SpeedButton1Click(Sender: TObject);begin udp.Send('localhost', 1234, 'abc123'); // 发送字符, 这样发中文接收方会乱码end;procedure TForm1.SpeedButton2... 阅读全文
posted @ 2015-12-16 18:21 王云盼 阅读(594) 评论(0) 推荐(0)
摘要:将字符串写入txt文档,读取txt文档中的内容。//一次写字符串到文本文件,每次都会将原来的内容替换掉。procedure FilePutContents(f,s:String); // f为文件名,s为存的内容var ss:TStrings;begin ss:=TStringList.Creat... 阅读全文
posted @ 2015-11-30 15:45 王云盼 阅读(969) 评论(0) 推荐(0)
摘要:代码编辑器:Home 回到当前行的头部End 回到当前行的尾部Insert 插入代码,覆盖后面的代码,(按回车无效), 再按撤回效果Delete 删除F1 双击一个单词后,按F1调用自带的Library 参考函数引用单元及用法F2 在Project上可... 阅读全文
posted @ 2015-11-28 14:38 王云盼 阅读(2115) 评论(0) 推荐(0)
摘要:用delphi自带的sqr和sqrt函数procedure TForm2.SpeedButton3Click(Sender: TObject);begin ShowMessage(Sqr(6).ToString); //36end;procedure TForm2.SpeedButton4C... 阅读全文
posted @ 2015-11-28 11:46 王云盼 阅读(928) 评论(0) 推荐(0)
摘要:书写格式: property Name: 类型 read (方法) write (方法) ; //default 可省略property Name: string read FName write SetName; // 读可以是函数也可以是变量property Name: string rea... 阅读全文
posted @ 2015-11-07 11:09 王云盼 阅读(286) 评论(0) 推荐(0)
摘要:private { Private declarations } FRow: Integer; procedure SetRow(const Value: Integer); public { Public declarations } property Row :... 阅读全文
posted @ 2015-11-06 15:23 王云盼 阅读(230) 评论(0) 推荐(0)
摘要:获取0至100中的0至29,42至100, 刚开始我想的太多,要小于29,大于42,这么多条件什么的。。。。 不多说了,我自己脑子没转过来var i,j: integer;begin j := 0; for i := 0 to 99 - 13 do begin memo1.Lines.a... 阅读全文
posted @ 2015-11-02 18:14 王云盼 阅读(180) 评论(0) 推荐(0)
摘要:{目的,取得下面字符串中的每一项内容,如s:='a,b,c,d',要去的用逗号隔开的每一项内容这时采用Tstring,会方便很多,TString是继承TStringList带有List所有属性。}var str: string; ss: TStringList;begin str := 'a... 阅读全文
posted @ 2015-10-29 18:41 王云盼 阅读(767) 评论(0) 推荐(0)
摘要:procedure TSetParkForm.edtPrePosExit(Sender: TObject); // 焦点移开 或已操作begin if (G2.RowCount > 0) and (G2.Selected >= 0) then begin // 判断G2是否有数据,且为选中状态 ... 阅读全文
posted @ 2015-10-28 21:24 王云盼 阅读(511) 评论(0) 推荐(0)
摘要:今天学到一个新函数,很有用QuotedStr(s);// 在s两边加单引号,这样就不会看着n多的单引号糊涂了。。。 阅读全文
posted @ 2015-10-28 14:56 王云盼 阅读(382) 评论(0) 推荐(0)
摘要:delphi 指针分为类型指针和无类型指针:类型指针分为PChar、PInteger、PString等。无类型指针Pointer。PPChar/PP...为指针的指针@和Addr一样,为获取变量存放的地址、^为指针指向的内容。@变量, Addr(变量), 指针^var p: pChar; ... 阅读全文
posted @ 2015-10-24 15:07 王云盼 阅读(327) 评论(0) 推荐(0)
摘要:var http: TIdHttp; sendtoserver: TStringStream; str: string; begin http := TIdHttp.Create(); // 创建 http.Ha... 阅读全文
posted @ 2015-10-24 10:46 王云盼 阅读(503) 评论(0) 推荐(0)
摘要:function TFormMain.GetWeek: string;var date:SYSTEMTIME;begin GetLocalTime(date); case date.wDayOfWeek of 0:Result:='星期天'; 1:Result:='星期一'; ... 阅读全文
posted @ 2015-10-22 21:13 王云盼 阅读(305) 评论(0) 推荐(0)
摘要:{*------------------------------------------------ 十六进制转换成十进制函数 @param @return-------------------------------------------------}function HexToInt(s... 阅读全文
posted @ 2015-10-22 21:12 王云盼 阅读(956) 评论(0) 推荐(0)
摘要:今天看了以前刚学D写的一个程序,发现好多垃圾代码,我有本事把Edit一个一个的写下去Edit1.MaxLength := 2;Edit2.MaxLength := 2;Edit3.MaxLength := 2;Edit4.MaxLength := 2;Edit5.MaxLength := 2;Edi... 阅读全文
posted @ 2015-10-22 21:00 王云盼 阅读(215) 评论(0) 推荐(0)
摘要:procedure AutoRunOnSystemStart(Title, FileName: String);const _Software_Microsoft_Windows_CurrentVersion_Run_ : string = '\Software\Microsoft\Windows\... 阅读全文
posted @ 2015-10-17 18:17 王云盼 阅读(620) 评论(0) 推荐(0)
摘要:uses Winapi.Windows;WinExec(PAnsiChar(Application.ExeName), sw_normal); // PAnsiChar : string to PAnsiChar 启动外部的exe 阅读全文
posted @ 2015-10-17 18:13 王云盼 阅读(625) 评论(0) 推荐(0)