advstringgrid的数据居中显示
摘要:在事件 procedure TForm1.advStringGrid1GetAlignment(Sender: TObject; ARow, ACol: Integer; var HAlign: TAlignment; var VAlign: TVAlignment);begin HAlign := taCenter; VAlign := vtaCenter;end;
阅读全文
posted @
2010-12-15 18:10
sunjun0427
阅读(1128)
推荐(0)
cdecl、stdcall、fastcall函数调用约定区别(转)
摘要:在C语言中,假设我们有这样的一个函数: int function(int a,int b) 调用时只要用result = function(1,2)这样的方式就可以使用这个函数。但是,当高级语言被编译成计算机可以识别的机器码时,有一个问题就凸现出来:在CPU中,计算机没有办法知道一个函数调用需要多少个、什么样的参数,也没有硬件可以保存这些参数。也就是说,计算机不知道怎么给这个函数传递参数,传递参数的工作必须由函数调用者和函数本身来协调。为此,计算机提供了一种被称为栈的数据结构来支持参数传递。 栈是一种先进后出的数据结构,栈有一个存储区、一个栈顶指针。栈顶指针指向堆栈中第一个可用的
阅读全文
posted @
2010-12-15 13:12
sunjun0427
阅读(327)
推荐(0)
没有找到borlandmm.dll 报错的解决方法
摘要:在程序中调用了DLL,用到了string,uses sharemem编译通过在本机运行没问题,打包后安装在其他机器上则提示无法找到borlndmm.dllDelphi2006~Delphi2011里直接用SimpleShareMem单元就可以避免使用borlandmm.dll了。
阅读全文
posted @
2010-12-12 22:52
sunjun0427
阅读(737)
推荐(0)
StringGrid指定某行列的背景和字体颜色
摘要:procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);vars: String;R: TRect;beginwith StringGrid1 dobeginif ARow=0 then Canvas.Font.Color := clWhite;if ACol=0 then Canvas.Font.Color := clWhite;if Cells[ACol,ARow] = '变色' then //找到内容为'变色'的单元格
阅读全文
posted @
2010-12-07 10:14
sunjun0427
阅读(4269)
推荐(0)
StringGrid cell中文字居中显示
摘要:在OnDrawCell中加入如下代码:procedure TForm1.Stringgrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);begin with Sender as TStringGrid do begin Canvas.FillRect(Rect); DrawText(Canvas.Handle, Pchar(Cells[ACol, ARow]), Length(Cells[ACol, ARow]), Rect, DT_CENTER or DT_SINGLE
阅读全文
posted @
2010-12-07 09:32
sunjun0427
阅读(878)
推荐(0)
Delphi SelectSingleNode的使用 根据节点属性获取该节点
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, msxml,StdCtrls;type TForm1 = class(TForm) btn1: TButton;...
阅读全文
posted @
2010-12-03 13:09
sunjun0427
阅读(1929)
推荐(1)
关于错误Access Violation和too many consecutive exceptions 解决方法
摘要:“如果DLL中用到了DELPHI的string类型,则DLL和主程序中都需要加上ShareMem”。DLL项目加ShareMem这个我知道,但主程序中也要加?这我就不明白了,为什么以前不加的时候没这个问题呢?加就加吧,果然加上后一点问题都没有。唉,真是搞不明白。最后在新建DLL项目时,DELPHI有一段注释给了我答案。library MyDll;{ Important no...
阅读全文
posted @
2010-12-01 09:54
sunjun0427
阅读(3998)
推荐(1)
Delphi在case语句中使用字符串
摘要:在case语句中使用字符串 (**** 转载敬请注明-本文出处:南山古桃(nsgtao)的百度空间:http://hi.baidu.com/nsgtao/ ****) 在 case 语句中使用字符串 --- by 熊恒(beta)我今天要介绍的是一个比较另类的方法。大家都知道,case 语句只能对顺序类型 (ordinal type)管用,那么我们先看一下顺序类型到底有那些呢:1)整型;2)字 符...
阅读全文
posted @
2010-11-30 11:23
sunjun0427
阅读(17169)
推荐(1)
Delphi2010 调用 delphi6,7 dll的PChar参数的兼容问题
摘要:Delphi2010 CallFunction:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) btn1: TButton; btn2: TButton; p...
阅读全文
posted @
2010-11-25 00:02
sunjun0427
阅读(1157)
推荐(0)
Delphi6 企业版升级包SP2下载链接地址
摘要:http://www.delphifans.com/SoftView/SoftView_333.html
阅读全文
posted @
2010-11-23 23:51
sunjun0427
阅读(932)
推荐(0)
Delphi如何传递二维数组
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObjec...
阅读全文
posted @
2010-11-19 09:26
sunjun0427
阅读(2802)
推荐(0)
TRzComboBox的使用
摘要:TRzComboBox支持items显示值,values存储真实需要值,比如一个编号,名称对照表,可以将编号列表存入values,将名称表存入items中.表中数据为:id text0 a1 b2 c通过数据库连接查询出结果集放入 clientdataset1中whlie not eof dobeginrzcombobox1.AddItemValue(clientdataset1.FieldByN...
阅读全文
posted @
2010-11-18 15:52
sunjun0427
阅读(1257)
推荐(0)
Delphi WebBrowser 响应回车Enter键(兼容Silverlight)
摘要:在Form放置一个ApplicationEvents控件, 在OnMessage事件中写下面的代码:uses ActiveXprocedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);const StdKeys = [VK_TAB, VK_RETURN, VK_DELETE, VK_BACK...
阅读全文
posted @
2010-11-09 11:00
sunjun0427
阅读(1104)
推荐(0)
Delphi对Excel的所有操作
摘要:学完这个你就成为excel高手了!(Delphi对Excel的所有操作)逐个试试!一)使用动态创建的方法首先创建Excel对象,使用ComObj:varExcelApp:Variant;ExcelApp:=CreateOleObject('Excel.Application');1)显示当前窗口:ExcelApp.Visible:=True;2)更改Excel标题栏:ExcelApp.Captio...
阅读全文
posted @
2010-11-05 09:38
sunjun0427
阅读(1718)
推荐(0)
托盘的实现(转)
摘要:unitUnit1;interfaceusesWindows,Messages,SysUtils,Classes,Graphics,Controls,Forms,Dialogs,shellapi,//ADDshellapiAppEvnts,ImgList,Menus;constghy_tray=wm_user+2;typeTForm1=class(TForm)ApplicationEvents1:...
阅读全文
posted @
2010-11-05 09:32
sunjun0427
阅读(229)
推荐(0)
7 个非常好的免费 Delphi 组件集(转)
摘要:你是否在寻找一些免费且多功能的 Delphi 组件为你的程序添加更强的功能?不用再寻找了,下面列出了在互联网上最好的一些 Delphi 组件,他们可是免费并且包含所有源代码的。(1)JEDI - VCLJEDI-VCL(JVCL) 库构建于 JEDI 社区捐赠的代码。他由超过 400 个可以在你的 Delphi 和 Kylix 项目中立即重用的组件构成。整个 JEDI VCL 在 Mozilla ...
阅读全文
posted @
2010-11-05 09:29
sunjun0427
阅读(652)
推荐(0)
Delphi两个遍历指定目录下指定类型文件的函数
摘要:// ================================================================// 遍历某个文件夹下某种文件,// 使用说明// _GetFileList(ListBox1.Items,'c:\*.doc');// _GetFileList(MyTStringList,'c:\*.exe');// ====...
阅读全文
posted @
2010-11-05 09:24
sunjun0427
阅读(454)
推荐(0)
Delphi 通过 Soap toolkit 3.0调用webservice
摘要:用Delphi 通过 Soap toolkit 3.0调用webservice先安装MS Soap toolkit 3.0unit CallWebServiceByComObject;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Comobj, St...
阅读全文
posted @
2010-11-04 15:18
sunjun0427
阅读(2693)
推荐(0)