- 博客(72)
- 资源 (11)
- 收藏
- 关注
转载 DBGrid 应用全书
在 Delphi 语言的数据库编程中,DBGrid 是显示数据的主要手段之一。但是 DBGrid 缺省的外观未免显得单调和缺乏创意。其实,我们完全可以在我们的程序中通过编程来达到美化DBGrid 外观的目的。通过编程,我们可以改变 DBGrid 的表头、网格、网格线的前景色和背景色,以及相关的字体的大小和风格。 以下的示例程序演示了对 DBGrid 各属性的设置,使 Delphi 显示的表
2008-10-30 23:25:00 2309
转载 键盘常用ASCII码
键盘常用ASCII码ESC键 VK_ESCAPE (27)回车键: VK_RETURN (13)TAB键: VK_TAB (9)Caps Lock键: VK_CAPITAL (20)Shift键: VK_SHIFT ($10/16)Ctrl键: VK_CONTROL (17)Alt键: VK_MENU (18)空格键: VK_SPACE ($20/32)退格键: VK_BACK (8
2008-10-30 22:17:00 1062
转载 Delphi 內存数据表
function CreateTableInMemory(const AFieldDefs:TFieldDefs):TDataSet;var TempTable:TClientDataSet;begin TempTable:=nil; Result:=nil;if AFieldDefsnil then begin try TempTable:=TClien
2008-10-28 11:38:00 1207
转载 DELPHI常用技巧
等待程序运行结束procedure TForm1.Button1Click(Sender: TObject); var sCommandLine: string; bCreateProcess: boolean; lpStartupInfo: TStartupInfo; lpProcessInformation: TProcessInformation; b
2008-10-28 11:32:00 671
原创 在窗体上移动控件
1procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);begin if ssleft in shift then begin image1.cursor:= crHandPoint; x_image:=x+image1.Left; y_ima
2008-10-28 00:21:00 585
原创 " 过滤字段不能被打开"
再编程中,使用 ADO 操作数据库。。。。有的时候。用 ADOQuery 来过滤数据。当被过滤的字段是整形字段时,不能使用 like 进行过滤;
2008-10-26 22:14:00 831
转载 format 的用法
function Format(const Format: string; const Args: array of const): string; $[SysUtils.pas 功能 返回按指定方式格式化一个数组常量的字符形式 说明 这个函数是我在Delphi中用得最多的函数,现在就列举几个例子给你个直观的理解 "%
2008-10-26 20:53:00 613
原创 函数可以返回一个值,变通一下,过程也行。
procedure CC(var a,b,c :Integer);begin c := a+b;end;procedure TForm1.FormCreate(Sender: TObject);var a ,b,c :Integer;begin a :=5; b:=5; c :=0; CC(a,b,c); ShowMessage(IntToStr(c)); {结果为 10 }end;
2008-10-26 20:22:00 529
原创 回车自动跳了下一个编辑框。
if Key=#13 then begin key:=#0; perform(WM_NEXTDLGCTL,0,0); end;
2008-10-25 13:11:00 834
原创 修改 DBNavigator 的 click事件;
下面的代码,功能在于 把按下 nbPost 和 nbInsert 键时,先判断一下,相关的输入框是否符合你自己的要求。如果不符合就 Abort 它即可。同理,可以将其它 按钮进行相应的处理以达到 修改其事件的目的。procedure TfrmBaseSetup.DBNavigator1BeforeAction(Sender: TObject; Button: TNavigateBtn);beg
2008-10-22 16:58:00 1103
转载 重命名MS SQL数据库的名称
重命名MSSQL数据库的名称,需要做用以下系统库master提供的存储过程SP_RENAMEDB,语法如下:use mastergoexec SP_RENAMEDB oldDBName, new DBNamego
2008-10-21 09:55:00 532
转载 DELPHI中控制EXCEL的一个例子
unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComObj;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3:
2008-10-21 09:54:00 706
转载 C# 时间格式 DateTime Format
DateTime dt = DateTime.Now;// Label1.Text = dt.ToString();//2005-11-5 13:21:25// Label2.Text = dt.ToFileTime().ToString();//127756416859912816// Label3.Text = dt.ToFileTimeUtc().ToString();//
2008-10-20 22:12:00 545
转载 获得QQ聊天输入框中的内容
// 首先得到输入框的句柄。通过spy++这类工具分析,聊天窗体的类名为“#32770”// 但当前系统里不只一个类名为“#32770”的窗体,这就需要全体遍历一次。// 类名为“#32770”标题含“聊天”基本能确定。为保险起见还判断一下所在进程是否为“qq.exe”uses PsAPI, RichEdit;function Process_ReadRichEditText(AHandle:
2008-10-18 08:44:00 848
转载 Delphi&C#代码模拟“显示桌面”的功能
今天有人问我:“用shell打开文件(显示桌面.scf)的方式还是用模拟键盘(Win+D)显示桌面”这应该有更好的方法,就搜了搜,关键字定位“ToggleDesktop”因为显示桌面.scf的内容是:[Shell]Command=2IconFile=explorer.exe,3[Taskbar]Command=ToggleDesktop找到了MSDN http://msdn.
2008-10-18 08:38:00 618
转载 DELPHI的铁杆拥护者是这样说的。
声明,此内容为转载内容 Delphi不是很好的嘛,为什么要转呢? 每每看到那些带着C++/C#或Java光环的浅薄无知者对Delphi妄加评论的时候,我从心底喷射出对他们的不屑一顾。Java有什么?一个架构于虚拟机上的啃着“大饼”的蜗牛而已;C++有什么?一个放荡不羁、自恋十足、霸道无比且习惯于自我炒作的西部牛仔而已;C#有什么?一个惯于用$挖别人墙角的小偷把
2008-10-18 00:32:00 553
转载 DBGridEh 多行选择
procedure TfrmMain.Button5Click(Sender: TObject);var I,J: Integer; SelectedRows :TBookmarkListEh ; s:string;begin ListBox1.Clear; if DBGridEh1.SelectedRows.Count >0 then begin with DBGridEh1.
2008-10-17 11:17:00 1070 1
原创 返回某年某月有多少天
闰年的判断:1、能被 400 整除2、能被 4 整除但是不能被 100 整除function ResultMonthDays(const yy, mm: Word): Byte;begin case mm of 1,3,5,7,8,10,12 : Result :=31; 4,6,9,11 : Result :=30; 2 : begin if (yy
2008-10-16 10:50:00 623
原创 考勤数据打印方法;
考勤数据。大多数情况下,都不会有星期天,有的时候还不满一个月。 可是打印的时候,希望能得到一张完整的全月考勤。 有一种方法是将要打印的数据 select into 到一个临时表(我用MSSQL)。然后再判断每一个人所缺的天数,然后插入日期和空的考勤数据; 这种方法是非常不可取,以前好象在哪里看到人有人这么样作; 谈谈我的作法: 建一个空表。字段 fWorker
2008-10-15 21:43:00 1243
转载 数据库查询速度优化 1 建立索引
Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 <object classid
2008-10-15 14:15:00 867
转载 优化SQL语句方法
1、不要使用游标2、规范化你的数据表3、不要使用SELECT *4、了解你将要对数据进行的操作5、不要给“性别”列创建索引6、使用事务7、小心死锁8、不要打开大的数据集9、不要使用服务器端游标10、使用参数查询11、在程序编码时使用大数据量的数据库12、不要使用INSERT导入大批的数据13、注意超时问题14、不要忽略同时修改同一记录的问题15、在细节表中插入纪录时,不要在主表执行SELECT
2008-10-15 14:11:00 612
转载 打开了之窗体的函数
打开子窗体procedure TfrmMain.OpenChildWnd(FormClass: TFormClass);var i:Integer; child:TForm;begin for I := 0 to MDIChildCount -1 do begin if MDIChildren[i].ClassType =FormClass then begin chi
2008-10-15 09:37:00 476
原创 控件编写:增强 TMEMO (一)
相信没有什么人对 MEMO 陌生了吧。尽管其组件的功能不错。但是,对它进行一些功能的改进,可以更好的使用。 有的时候,我们想要知道,当前的坐标是什么?甚至,想要在 滚动条滚动时触发一些事件。 但,TMemo 本身并没有这样的功能。那我们就要扩展它; 那我们现在就来作: file -> new -> other -> package 在 dpk 窗口上,
2008-10-14 22:05:00 1080
转载 使用飞信SDK开发短信收发程序
利用飞信的协议可以在线收发消息,或是向手机发送消息。由此,可以自己来完成一个IM工具。本文即是对飞信SDK的使用方法,及如何开发作一个说明。一、引用FetionSDK飞信是采用C#开发的,所有的程序集均是.NET,因此我们也需要使用Delphi.NET/Chrome来进行相关的开发。在Chrome中,新建一个工程,并引入FetionSDK.dll,当然您也可以使用Delphi
2008-10-14 21:41:00 1791
转载 Delphi 组件编写--扑克牌组件
在网上看了不少关于扑克牌组件的编写,大多是调用Windows/system32下的cards.dll其实我们如果不调用这些函数也是可以作一个很好扑克牌组件。具体步骤如下: 1、首先做一个位图文件,符合如下格式,所有的扑克牌均为同样大小,每种花色排一行,从A到K排列,花色按黑桃、红桃、方块、梅花排列。如果不想做可以从QQgame 下的CardRes.dll中导出,本组件就用的就
2008-10-13 17:45:00 1084
转载 Delphi自定义组件(1)
组件是Delphi应用程序的基本元素。尽管大多数组件代表用户界面的可见元素,但组件也可以是程序中的不可见元素,如数据库组件。在前面的学习中,我们已经能够根据程序功能需要,合理地选择和应用Delphi提供的组件,同时,Delphi中也允许用户自己定义组件,实现相关的功能。8.4.1 组件基础知识Delphi的组件都是VCL(Visual ComponentLibrary,可视组
2008-10-13 17:42:00 1235
转载 如何用Delphi编写自己的可视化控件
可视化控件(VisualComponent)实际上就是一个类(class),要编写一个类,可以直接在*.pas文件中编写。但是要编写控件,则必须使用包(package)。从File菜单中选择New,新建一个Package,这就是存放和安装控件用的包。然后单击Package窗口中的Add按钮,添加一个元件(Unit)。 在弹出的对话框最上方选择NewComponent。因为一
2008-10-13 00:11:00 1024
转载 编写控件的高级技巧
在DELPHI中编写控件,即如何定义一个新的属性类型,来实现自己的目的?例如有的控件在DELPHI的IDE中的属性窗口中加上作者的信息或者双击控件弹出关于窗口等。下面就以“关于”窗口来说明该技巧的实现方法。 先定义一个新的控件“TTestComponent”。所有代码均在里面加入。 1、让我们先定义一个新的属性类型“TTestAbout”。type TTestAbout
2008-10-13 00:09:00 751
转载 在Delphi中编写控件的基本方法(1)
作为Delphi程序员,要想进一步提高编程水平就必须掌握控件的编写方法,本篇文章将通过一个简单的例子来为初学者介绍编写控件的一些基本方法和模式。 这个例子控件叫TLeiLabel,是在TLabel的基础上增加两个实用的功能:一是使文字具有立体形状,二是使文字具有超链接属性。下面就让我们一步步来实现这些功能。
2008-10-13 00:07:00 674
转载 Delphi 在内存中运行EXE程序,从资源文件中加载
unit MemRun;interfaceuses windows;function MemExecute(const ABuffer; Len: Integer; CmdParam: string; var ProcessId: Cardinal): Cardinal;implementation//{$R ExeShell.res} // 外壳程序模板(98下使用)typeTImageSect
2008-10-12 22:22:00 3426
转载 飞信的协议分析
转自:http://hi.baidu.com/nathan2007/blog/category/%B7%C9%D0%C5%D0%AD%D2%E9%B7%D6%CE%F6作者:nathan以下分析均基于飞信的这一版本:Fetion 2006 beta 版本 2.1.0.0。 被迫开始用飞信(Fetion),痛苦啊,这玩意儿开发了几年(飞信博客上一家伙说参加飞信项目两年了),而
2008-10-11 11:27:00 4034 1
转载 SQL 2005修改系统表
Student(S#,Sname,Sage,Ssex) 学生表 Course(C#,Cname,T#) 课程表 SC(S#,C#,score) 成绩表 Teacher(T#,Tname) 教师表 问题: 1、查询“001”课程比“002”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC where C#=001) a,(sel
2008-10-08 23:26:00 639
原创 SQL语句大全
--语 句 功 能 --数据操作 SELECT --从数据库表中检索数据行和列 INSERT --向数据库表添加新数据行 DELETE --从数据库表中删除数据行 UPDATE --更新数据库表中的数据 --数据定义 CREATE TABLE --创建一个数据库表 DROP TABLE --从数据库中删除表 ALTER TABLE --修改数据
2008-10-08 23:22:00 390
转载 盖茨留给职场青年的十句警言
1.社会充满不公平现象。你先不要想去改造它,只能先适应它。 (因为你管不了它) 2.世界不会在意你的自尊,人们看的只是你的成就。在你没有成就以前,切勿过分强调自尊。 (因为你越强调自尊,越对你不利) 3.你只是中学毕业,通常不会成为CEO,直到你把CEO职位拿到手为止。 (直到此时,人们才不会介意你只是中学毕业) 4.当你陷入人为困境时,不要抱怨,你只能默默地吸取教训。
2008-10-07 21:10:00 507
原创 使用批处理自动上传文件到FTP
echo open xxx.xxx.xxx.xxx >ftp.txtecho user >>ftp.txtecho password >>ftp.txtecho binary >>ftp.txt [可选]echo cd directory >>ftp.txtecho get update.rar >>ftp.txtecho bye >>ftp.txtftp -s:ftp.txt
2008-10-07 17:19:00 730
原创 函数返回多个值的方法;
其实,定一个类,就可以了。type TDEMO = record ISOK : boolean; Comment : string; end;function abc : TDEMO;begin Result.ISOK := True; Result.Comment := Hello;end;procedure test;var AAA:TDE
2008-10-07 16:11:00 657
原创 最直白的言语来解释什么是“云计算”
很多东西,明明很简单。有些人就是在故作高深。有一些雾里看花的词来形容。 但最终说的本质,你会发觉。那些高深的语言表达竟然就是这么个玩儿。 最拿现在说得最多的“云计算”吧。 光看这三个字挺高深的吧,由一个大公司GOOGLE提出来,微软、IBM等表示支持甚至作相关的产品等。 可是什么是“云计算”呢? 其实不就是用一堆廉价服务器进行并联来使用吗?这个东西的出现就是为
2008-10-06 12:48:00 776
原创 SQL日期和时间函数
1.一个月第一天的Select DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)2.本周的星期一Select DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)3.一年的第一天Select DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)4.季度的第一天Select DATEADD(qq, DATEDI
2008-10-04 23:17:00 575
原创 两日期相差的天数
Uses DateUtils function DaysBetween(const ANow, AThen: TDateTime): Integer;
2008-10-04 21:36:00 430
转载 反射机制传递类
鉴于某人说Delphi的反射不能传入或传出类,我在此纠正一下这个说法,下面的代码可以证实,类可以传入传出。由于我已经把D2009的反射单元移去D2007,因此就不用D2009了,所以代码中暂时不考虑Unicode的问题。 unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes,
2008-10-04 15:30:00 514
CrossVcl 1.53.7z
2021-05-28
FlyTreeViewPro.Suite.7z
2020-06-02
控件开发基础.rar
2020-06-02
InfoPower 4K v20.0.2.3 for XE10.3 RIO_ByJoe.7z
2019-08-04
TscExcelExport 3.6 full source
2008-12-23
Ehlib 4.3.2.1 (完整源代码)
2008-12-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人