孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

随笔分类 -  DELPHI

上一页 1 2 3 4 5 6 7 下一页

摘要:Acrobat,AcroPDF 阅读全文
posted @ 2010-07-20 17:03 孤独的猫 阅读(573) 评论(0) 推荐(0) 编辑

摘要:一.用C语言写了一个Dll,编译成功。是一个非常简单的加密算法,代码如下:#include<stdio.h>__declspec(dllexport) void Encipher(char a[16]) {int i,len;int s=1; len=strlen(a);for(i=0;i<len;i++){ a[i]=a[i]+s; s=s+2;} }现在我在Delphi中如何调用它并实现这样的功能,点击Button1,获取edit1.text的内容,存于数组中,然后调用Dll中的函数,进行简单加密,然后将结果赋给edit2.text。 type TArrChar = ar 阅读全文
posted @ 2010-07-19 23:47 孤独的猫 阅读(1937) 评论(0) 推荐(0) 编辑

摘要:cxGrid 阅读全文
posted @ 2010-07-19 12:08 孤独的猫 阅读(6493) 评论(0) 推荐(1) 编辑

摘要:Delphi,FTP,源码 阅读全文
posted @ 2010-07-18 11:22 孤独的猫 阅读(884) 评论(0) 推荐(0) 编辑

摘要:Implementation goes this way: type TSampleEnumType = (seNone, seONE, seTWO, seTHREE, seFOUR); TSampleRecord = record SampEType: TSampleEnumType; iValue: integer; end; const TConstArrayofRecord: array [0..4] TSampleRecord ( (SampEType: seNONE; iValue: 0), (SampEType: seONE; iValue: 1), (SampEType: se 阅读全文
posted @ 2010-07-12 15:17 孤独的猫 阅读(509) 评论(0) 推荐(0) 编辑

摘要:const DayList: array[0..6,1..4] of SmallInt =((1, 5,11,1), (6, 10,11,1), (11,15,17,2), (16,20,23,3), (21,25,23,3), (26,31,11,1), (99,99,17,2) ); TShopItem = record Name : string; Price : currency; end;const Items : array[1..3] of TShopItem = ( (Name : 'Clock'; Price : 20.99), (Name : 'Pe 阅读全文
posted @ 2010-07-12 15:14 孤独的猫 阅读(1181) 评论(0) 推荐(0) 编辑

摘要:1.FastReport中如何共用TFrxreport及TfrxDBDataSet 一个程序中,不管多么大的程序,只要打印或预览时是模式的,则完全可以共用一个TFrxreport 变量及几个TfrxDBDataSet。只不过,要注意完成一个报表程序的步骤,主要是下面几步 阅读全文
posted @ 2010-07-10 22:23 孤独的猫 阅读(3778) 评论(0) 推荐(0) 编辑

摘要:动态创建Fastreport分以下几个步骤: 1.首先清空Fastreport,定义全局变量,并加载数据集 frReport.Clear; frReport.DataSets.Add(frxDBDataset1); DataHeight :=28; DataWidth :=80; FirstTop := 50; FirstLeft := 15; 阅读全文
posted @ 2010-07-10 10:25 孤独的猫 阅读(4792) 评论(0) 推荐(0) 编辑

摘要:by tinyANT on 三月 24, 2009, under FASTREPORT, 包裹, 民本, 碎末, 1,758 views写在前面的话:翻译水平有限,只为更加方便查阅和使用,如果翻译不准确的地方欢迎指正,资料来源于FastReport官方网站。一、使用TfrxReport 组件工作1、加载并存储报表默认情况下,报表窗体同项目窗体构存储在同一个DFM文件中。多数情况下,无须再操作,因而你就不必采用特殊方法加载报表。如果你决定在文件中存储报表窗体或者是数据库的Blob字段(他提供了非常大的弹性,你能够在非编译程序中修改),你必须使用“TfrxReport”提供的加载和存储方法。fun 阅读全文
posted @ 2010-07-09 17:39 孤独的猫 阅读(473) 评论(0) 推荐(0) 编辑

摘要:网上查了下,貌似WriteComponentResFile,ReadComponentResFile可以,但是必须是一个TComponet的对象,我要串行化一个OleVariant的对象,大大们,怎么做?要持久对象,必须继承TPersistent....function ComponentToStr(AComponent: TComponent): string; var BinStream: TMemoryStream; StrStream: TStringStream; s: string; begin BinStream := TMemoryStream.Create; try StrS 阅读全文
posted @ 2010-05-15 09:24 孤独的猫 阅读(197) 评论(0) 推荐(0) 编辑

摘要:CreateFontIndirect - 根据字体结构建立逻辑字体 //声明:CreateFontIndirect(const p1: TLogFont {字体结构}): HFONT; {返回新字体指针}//TLogFont 是 tagLOGFONTA 结构的重定义:tagLOGFONTA = packed recordlfHeight: Longint; {字体高度}lfWidth: Longint; {字体平均宽度}lfEscapement: Longint; {角度, 单位是 1/10 度}lfOrientation: Longint; {基线角度}lfWeight: Longint; 阅读全文
posted @ 2010-05-14 14:59 孤独的猫 阅读(948) 评论(0) 推荐(1) 编辑

摘要:procedure SetPrinterPaper(APaperNo: Integer; APaperWidth,APaperHeight: Double);//设置当前打印机的纸张大小//纸张号 9 A4 13 B5//页宽和页高,单位mmvarDevice: array[0..255] of char;Driver: array[0..255] of char;Port: array[0..255] of char;hDMode: THandle;PDMode: PDEVMODE;beginPrinter.PrinterIndex := Printer.PrinterIndex;Print 阅读全文
posted @ 2010-05-14 14:55 孤独的猫 阅读(896) 评论(0) 推荐(0) 编辑

摘要:TMyString = class(TObject)private FStrBeginTran: string; FStrEndTran: string;protected function GetData(myData: TMyField): string; virtual; function GetFields(myData: TData): string; virtual;public property StrBeginTran: string read FStrBeginTran; property StrEndTran: string read FStrEndTran; class 阅读全文
posted @ 2010-05-14 14:30 孤独的猫 阅读(268) 评论(0) 推荐(0) 编辑

摘要:function GetIDInfoGetDInfo(const CardNo: string; var Sex,BirthDay: string; var Age: Integer; var Area: string): Integer;variCardNo: Int64;iYear, iSex: Integer;sBirth, fBirth: string;dBirth: TDateTime;beginResult := 0; //表示身份证输入正确if (Length(CardNo) <> 15) and (Length(CardNo) <> 18) thenbe 阅读全文
posted @ 2010-05-14 14:25 孤独的猫 阅读(420) 评论(0) 推荐(0) 编辑

摘要:procedure CloseEDTIME(edt: TEdit);varKeyStates: TKeyboardState;beginGetKeyboardState(KeyStates);if (KeyStates[VK_CAPITAL] = 1) thenbegin SetCapsLockKey(VK_CAPITAL, TRUE); //关大写end;Closeime(edt.Handle);end;procedure OpenEDTIME(edt: TEdit);varKeyStates: TKeyboardState;beginGetKeyboardState(KeyStates); 阅读全文
posted @ 2010-05-14 14:21 孤独的猫 阅读(764) 评论(0) 推荐(0) 编辑

摘要://去除左边的全角function MyTrimLeft(const S: string): string;varci, sl: integer;c: char;beginci := 1; sl := length(S);while (ci <= sl) dobegin c := S[ci]; case c of ' ': inc(ci); #161: if (ci < sl) and (S[ci + 1] = c) then inc(ci, 2); else break; end;end;Result := Copy(S, ci, sl);end;//去除右边的全 阅读全文
posted @ 2010-05-14 14:16 孤独的猫 阅读(412) 评论(0) 推荐(0) 编辑

摘要://Delphiprocedure TForm1.ButtonLevelUpClick(Sender: TObject);var ARecord: TcxCustomGridRecord;begin with TcxCustomGridTableView(Grid.FocusedView) do begin ARecord := Controller.FocusedRecord; if Assigned(ARecord) then begin ARecord := ARecord.ParentRecord; if Assigned(ARecord) then ARecord.Focused : 阅读全文
posted @ 2009-10-03 17:05 孤独的猫 阅读(1096) 评论(0) 推荐(0) 编辑

摘要:在TdxDBTreeView控件的OnKeyDown事件中写入if Key = VK_F2 thenbegin if DBTreeMain.DBSelected = nil then Exit; DBTreeMain.DBSelected.EditText;end; 阅读全文
posted @ 2009-10-03 17:04 孤独的猫 阅读(219) 评论(0) 推荐(0) 编辑

摘要:利用TdxDBTreeView控件(此处设为DBTreeMain)时,可以从表中直接显示出树结构,有时需要拖动对节点进行排序,而且数据表中有字段SortCode用于排序码,此时需要编写对应代码,步骤如下1.先设置DBTreeMain的DragMode属性为dmAutomatic2.设置DBTreeMain的StateIndexField属性为SortCode3.在其OnEndDragTreeNode事件中写入var m: TNodeAttachMode; oldOption: TdxDBTreeViewOptions; node: TdxDBTreeNode; bm: TBookmarkStr 阅读全文
posted @ 2009-10-03 17:03 孤独的猫 阅读(761) 评论(0) 推荐(0) 编辑

摘要:cxGrid的使用方法1. 去掉cxgrid中台头的box ,在tableview1的ptionsview的groupbybox=false;2. 在GRID footer 中加入sum(列), tableview1的optionsview的footer=ture然后在cxGRid1的customize..中的summary 的footer.add需要合计的列kind= skSum3. 去掉cxgrid 中的过滤下拉箭头选择tableview1.optionscustomize.columnfiltering=fasle;4. cxGrid1DBTableView1 的 OptionView中 阅读全文
posted @ 2009-10-03 17:02 孤独的猫 阅读(2941) 评论(0) 推荐(1) 编辑

上一页 1 2 3 4 5 6 7 下一页