随笔分类 -  delphi点滴

请教万老师及其他
试题:编程查找指定目录下所有EXE文件,并将其全路径存入Result.txt中,要求用递归。。。?
摘要:未用递归,希望能得到有关人士帮帮忙,先谢过了... 下面是我的程序:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; ListBox1: TListBox; procedure Button1Click(Sender: TObject); private procedure _GetFileList(AStrings... 阅读全文

posted @ 2011-10-11 11:45 mytina 阅读(194) 评论(0) 推荐(0)

万老师讲:简体中文与繁体中文的转换函数
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end;var Form1: TForm1;implementation{$R *.dfm}function GB2Big(GB: string): string;var Len: Integ 阅读全文

posted @ 2011-08-02 16:39 mytina 阅读(161) 评论(0) 推荐(0)

万老师讲:如何修改已存在的类? (class helper 可能是从 Delphi 2007 增加的新语法)
摘要:Txxx = class helper for T... {T... 表示已存在的类} {可以替换已存在的方法} {也可以有新的方法、成员}end;//这之后再使用 T... 类及其子孙类时, 都会优先使用 Txxx 的修改.例一:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Clic 阅读全文

posted @ 2011-08-02 16:29 mytina 阅读(500) 评论(0) 推荐(0)

万老师讲:通过消息跨进程发送与接收 TCopyDataStruct 数据
摘要:发送代码:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; procedure Button1Click(Sender: TObject); end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(S 阅读全文

posted @ 2011-08-01 13:29 mytina 阅读(193) 评论(0) 推荐(0)

如何删除动态数组的指定元素
摘要:如何删除动态数组的指定元素type TArr = array of TPoint; {把数组先定义成一个类型会方便许多, 这里仅用 TPoint 测试}{删除动态数组指定元素的过程: 参数 arr 是数组名, 参数 Index 是要删除的索引}procedure DeleteArrItem(var arr: TArr; Index: Integer);var Count: Cardinal;begin Count := Length(arr); if (Count = 0) or (Index < 0) or (Index >= Count) then Exit; Move(arr 阅读全文

posted @ 2011-07-26 15:04 mytina 阅读(458) 评论(0) 推荐(0)

万老师讲:如何删除动态数组的指定元素
摘要:如何删除动态数组的指定元素type TArr = array of TPoint; {把数组先定义成一个类型会方便许多, 这里仅用 TPoint 测试}{删除动态数组指定元素的过程: 参数 arr 是数组名, 参数 Index 是要删除的索引}procedure DeleteArrItem(var arr: TArr; Index: Integer);var Count: Cardinal;begin Count := Length(arr); if (Count = 0) or (Index < 0) or (Index >= Count) then Exit; Move(arr 阅读全文

posted @ 2011-07-26 14:48 mytina 阅读(218) 评论(0) 推荐(0)

万老师讲:如何让TreeView 的列表项携带数据、并读出或删除这个数据
摘要:准备工作:1、在空白窗体上添加 TreeView1 和 Button12、激活窗体的 OnCreate 事件, 激活 TreeView 的 OnDblClick 事件全部代码如下:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls;type TForm1 = class(TForm) TreeView1: TTreeView; Button1: TButton; procedure FormC 阅读全文

posted @ 2011-07-26 13:49 mytina 阅读(338) 评论(0) 推荐(0)

导航