孤独的猫

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

2009年10月3日

摘要: 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 孤独的猫 阅读(2952) 评论(0) 推荐(1) 编辑

摘要: 假设cxgrid为cxMain,TableView为ViewSelData,现在要根据数据集的colColorMark来改变本行的颜色,则可在ViewSelData的OnCustomDrawCell写入if AViewInfo.RecordViewInfo.GridRecord.Values[colColorMark.Index] = null then Exit;case AViewInfo.RecordViewInfo.GridRecord.Values[colColorMark.Index] of 1: ACanvas.Brush.Color := $FF0080; 2: ACanvas 阅读全文
posted @ 2009-10-03 17:00 孤独的猫 阅读(432) 评论(0) 推荐(0) 编辑

2009年9月2日

摘要: 键值大全 日期:2004年8月31日 作者: 人气:147 查看:[大字体 中字体 小字体] 在keydown事件里面showmessage(inttostr(key));在keypress事件里面showmessage(key);就知道了。Form1.KeyPreview := True;procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);beginShowmessage(IntToStr(Key));end;procedure TForm1.FormKeyPress(Sender: 阅读全文
posted @ 2009-09-02 16:38 孤独的猫 阅读(295) 评论(0) 推荐(0) 编辑

摘要: 一.参数类型 Object Pascal语言允许五种类型的参数(不是指参数的数据类型),分别是数值参数、常量参数、变量参数、无类型的参数、开放数组参数。 不管是哪一种参数类型,在调用过程或函数时,实参跟形参在个数上必须相同,在数据类型上必须赋值相容。-------------------------------------------------------------------------------- 数值参数 数值参数是一种最常见的参数,当调用过程或函数时,程序把实参的值复制一个副本,传递给数值参数,数值参数对过程或函数而言是局部变量,对数值 参数的修改不会直接改变实参的值。 注意:作 阅读全文
posted @ 2009-09-02 16:37 孤独的猫 阅读(448) 评论(0) 推荐(0) 编辑

摘要: 1。代码模板 : CTRL+J 2。代码整块移动 : CTRL+SHIFT+I(右移) CTRL+SHIFT+U(左移) 3。选中窗体 : 先选中任一控件,SHIFT+鼠标左键 4。将鼠标指向变量名、单元名、类名,再用 CTRL+鼠标左键,可找到相应的说明 5。在过程、函数、事件内部, SHIFT+CTRL+向上的方向键 可跳跃到相应的过程、函数、事件的定义,相反,在过程、函数、事件的定义处,SHIFT+CTRL+向下的方向键 可跳跃到具体过程、函数、事件内部 CTRL+ SHIFT + C:编写申明或者补上函数. 用esc选择上层对象 SHIFT+CTRL+E 显示 EXPLORER ,我觉 阅读全文
posted @ 2009-09-02 16:34 孤独的猫 阅读(305) 评论(0) 推荐(0) 编辑

2009年3月9日

摘要: #include<stdio.h>#include<malloc.h>#define ERROR 0#define TRUE 1#define FALSE 0#define OK 1#define EQUAL 1#define OVERFLOW -1#define STACK_INIT_SIZE 100#define STACKINCREMENT 10typedef int SElemType;typedef int Status;struct STACK{ SElemType num; SElemType *base; SElemType *top; int stac 阅读全文
posted @ 2009-03-09 21:38 孤独的猫 阅读(168) 评论(0) 推荐(0) 编辑

2009年3月3日

摘要: DevC++4.9.9.2中,按F8开始调试。提示信息为:工程没有调试信息,您想打开工程的调试选项并重新生成吗?选择是后,再按F8,仍旧是这个信息。什么原因呢?按照帮助,FrequentlyAskedQuestions(FAQ)中提示HowdoienableDebuggingmode?GotoCompilerOptionsandclickontheCompilersheet.IntheLinkersection,putprojectes?to'Generatedebugginginformation'.Doa'RebuildAll'andyoushouldbea 阅读全文
posted @ 2009-03-03 13:37 孤独的猫 阅读(301) 评论(0) 推荐(0) 编辑

2009年2月27日

摘要: 在TdxDBTreeView控件的OnEditing事件中写入AllowEdit := CheckEdit; //CheckEdit为判断的函数 阅读全文
posted @ 2009-02-27 21:17 孤独的猫 阅读(219) 评论(0) 推荐(0) 编辑

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

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

摘要: cxgrid单击某一网格事件,可在ViewTable的KeyPress事件中判断if Key = #32 thenbegin if Trim(colname.EditValue) = '' then colcode.FocusWithSelection //else // colReqNum.Editing := True;end; 阅读全文
posted @ 2009-02-27 21:13 孤独的猫 阅读(210) 评论(0) 推荐(0) 编辑

摘要: 1.去掉cxgrid或dxdbgrid的分组标题行设置TableView中的optionview中的GroupByBox为False2.设置排序字段打开TableView中,看到右边的字段,单击要分组的字段名,设置其GroupIndex为0,1等(默认值-1不分组)3.自动过滤设置与禁止设置TableView中的OptionsCustomize中的ColumnFiltering为True时自动过滤,False为禁止过滤CxGrid使用小结(续) ======================================================================== 激活 阅读全文
posted @ 2009-02-27 21:13 孤独的猫 阅读(361) 评论(0) 推荐(0) 编辑

摘要: 假设cxgrid为cxMain,TableView为ViewSelData,现在要根据数据集的colColorMark来改变本行的颜色,则可在ViewSelData的OnCustomDrawCell写入if AViewInfo.RecordViewInfo.GridRecord.Values[colColorMark.Index] = null then Exit;case AViewInfo.RecordViewInfo.GridRecord.Values[colColorMark.Index] of 1: ACanvas.Brush.Color := $FF0080; 2: ACanvas 阅读全文
posted @ 2009-02-27 21:00 孤独的猫 阅读(253) 评论(0) 推荐(0) 编辑

2008年11月7日

摘要: unit uPrinter;interfaceuses Printers, types, Windows, Classes, SysUtils, Forms;function CharHeight: Word;function AvgCharWidth: Word;function GetPhicalPaper: TPoint;function PaperLogicSize: TPoint;function HVLogincRatio: Extended;function GetOffSetX: Integer;function GetOffSetY: Integer;function MmT 阅读全文
posted @ 2008-11-07 10:18 孤独的猫 阅读(602) 评论(0) 推荐(0) 编辑

2008年10月15日

摘要: CREATE PROCEDURE sp_page@tb varchar(50), --表名@col varchar(50), --按该列来进行分页@coltype int, --@col列的类型,0-数字类型,1-字符类型,2-日期时间类型@orderby bit, --排序,0-顺序,1-倒序@collist varchar(800),--要查询出的字段列表,*表示全部字段@pagesize int, --每页记录数@page int, --指定页@condition varchar(800),--查询条件@pages int OUTPUT --总页数AS/*功能描述:对指定表中满足条件的记 阅读全文
posted @ 2008-10-15 12:22 孤独的猫 阅读(162) 评论(0) 推荐(0) 编辑

2008年9月29日

摘要: DECLARE @object intDECLARE @hr intEXEC@hr=sp_OACreate 'CDONTS.NewMail',@object OUTEXEC @hr=sp_OASetProperty @object,'From','Your Friend'EXEC @hr=sp_OASetProperty @object,'Body','This is a test'EXEC @hr=sp_OASetProperty @object,'Subject','Test of CD 阅读全文
posted @ 2008-09-29 12:11 孤独的猫 阅读(531) 评论(0) 推荐(0) 编辑

摘要: 1.在许多论坛的登录页面上,都有一个附加码,这样做的目的是防止有人利用破解程序,暴力破解里面的密码2.生成附加码的代码:<%Response.Buffer=falseNumCodeFunction NumCode()Response.Expires=-1Response.AddHeader "Progma","no-cache"Response.AddHeader "cache-control","no-cache"dim rndnum,i,jdim Ados,Ados1Do While len(rndnum 阅读全文
posted @ 2008-09-29 11:56 孤独的猫 阅读(236) 评论(0) 推荐(0) 编辑

摘要: set myMail=CreateObject("CDONTS.NewMail")myMail.SetLocalIDS(65001)myMail.From=txtMailFrommyMail.To=txtMailTomyMail.Subject="Subject"myMail.BodyFormat=0myMail.MailFormat=0myMail.Body=mailbodymyMail.SendSet myMail=Nothing在发送的ASP页面中写入@LANGUAGE=VBScript CODEPAGE=65001session.CodePage 阅读全文
posted @ 2008-09-29 11:53 孤独的猫 阅读(162) 评论(0) 推荐(0) 编辑

摘要: userip=Request.ServerVariables("HTTP_X_FORWORD_FOR")if userip="" thenuserip=Request.ServerVariables("REMOTE_ADDR")End if 阅读全文
posted @ 2008-09-29 11:50 孤独的猫 阅读(135) 评论(0) 推荐(0) 编辑

2008年9月26日

摘要: 一、窗体二、代码窗体代码:unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,BleepInt;type TForm2 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Button5: TButton; Button6: TButton; procedure Button1Click(Se 阅读全文
posted @ 2008-09-26 20:59 孤独的猫 阅读(441) 评论(0) 推荐(0) 编辑

2008年9月25日

摘要: <table width="100%" height="49" border="0" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">其中重点是cellspacing="1" cellpadding="3" bgcolor="#CCCCCC" 其中bgcolor可以换成需要的颜色,还有bordercolordark和bordercolorlight连个属 阅读全文
posted @ 2008-09-25 20:16 孤独的猫 阅读(213) 评论(0) 推荐(0) 编辑

摘要: 一、查看数据库的版本select @@version常见的几种SQL Server2000打补丁后的版本号8.00.194 Microsoft SQL Server 20008.00.384 Microsoft SQL Server 2000 SP18.00.532 Microsoft SQL Server 2000 SP28.00.760 Microsoft SQL Server 2000 SP38.00.818 Microsoft SQL Server 2000 SP3 w/cumuloative patch MS03-0318.002039 Microsoft SQL Server 20 阅读全文
posted @ 2008-09-25 17:46 孤独的猫 阅读(295) 评论(0) 推荐(0) 编辑

摘要: 一、计算unicode字符串的Ansi编码的长度Function strUnicodeLen(asContents)asContents1="a" & asContentslen1=len(asContents1)k=0for i=1 to len1asc1=asc(mid(asContents1,i,1))if asc1<0 then asc1=65536+asc1if asc1>255 thenk=k+2elsek=k+1end ifnextstrUnicodeLen=k-1End Function二、将Unicode编码的字符串转换为Ansi编码的 阅读全文
posted @ 2008-09-25 17:28 孤独的猫 阅读(294) 评论(0) 推荐(0) 编辑

摘要: 一、直接用ADO连接Excel直接用ADOQuery连接,其ConnectionString设为Provider=microsoft.jet.oledb.4.0;data source=C:\\2.xls;Extended Properties='Excel 8.0',HDR=Yes;IMEX=1'SQL属性:select * from [Result$] where month(addtime)>'6'二、借助SQL SERVER的OpenDataSource函数使用adoquery控件constcConstr='Provider=SQL 阅读全文
posted @ 2008-09-25 17:09 孤独的猫 阅读(334) 评论(0) 推荐(0) 编辑

摘要: 一、DTS简介DTS为导入导出模块,在SQL SERVER中有专门的导入导出工具二、调用SQL SERVER导出的包若要执行保存为COM结构化的存储文件DTS包,使用dtsrun /Ffilename /Npackage_name /Mpackage_password若要执行保存在SQL SERVER msdb中的DTS包,使用dtsrun /Sserver_name /Uuser_name /Ppassword /Npackage_name /Mpackage_password若要执行保存在Meta Data Services中的DTS包,使用:dtsrun /Sserver_name /U 阅读全文
posted @ 2008-09-25 16:33 孤独的猫 阅读(498) 评论(0) 推荐(0) 编辑

2008年9月24日

摘要: 一.用HTML元素对象的onselectstart事件防止用户选择网页方法是body中插入如下代码 <body onselectstart="return false">二.用HTML元素对象的oncopy和oncut事件防止用户复制网页内容,方法是在body中插入如下代码:<body oncopy="return false" oncut="return false">三.用HTML元素对象的onpaste事件防止用户粘贴网页的内容,方法是在body中插入如下代码:<body onpaste=" 阅读全文
posted @ 2008-09-24 17:03 孤独的猫 阅读(321) 评论(0) 推荐(0) 编辑

摘要: <html><head><title>浏览器选择</title> <%Dim BrowseMsgBrowseMsg=Request.ServerVariables("HTTP_USER_AGENT")Response.Write(BrowseMsg)If Instr(BrowseMsg,'FireFox')>0 thenResponse.Write('为FireFox浏览器')ElseIf instr(BrowseMsg,'MSIE')>0 thenRespon 阅读全文
posted @ 2008-09-24 16:57 孤独的猫 阅读(172) 评论(0) 推荐(0) 编辑

摘要: 1.getYear函数Javascript中getYear函数取得当前年份,但对于IE和FireFox却不同,IE中显示2006,而FireFox中则显示与1900的差值1062.getFullYear通用函数为了使年份值可以通用,可用Javascript中的getFullYear函数代替getYear 阅读全文
posted @ 2008-09-24 16:55 孤独的猫 阅读(144) 评论(0) 推荐(0) 编辑

摘要: 1.将字符串转为数组方法:先创建一个动态数组,数组大小等于字符串的长度,然后依次取出字符串中的每个字符存入该动态数组中,最后将数组返回,代码如下:'将字符串string1转换为数组Public Function StringToArray(ByVal string1)Dim i,Array1()Redim Array1(Len(string1))For I=1 to Len(String1)Array1(I-1)=Mid(string1,I,1)NextStringToArray=Array1End Function2.将数组转换为字符串方法:先定义一个字符串变量;然后根据数组的维度依 阅读全文
posted @ 2008-09-24 10:19 孤独的猫 阅读(696) 评论(0) 推荐(0) 编辑

摘要: Public Function FilterHTML(str)If Trim(str)=" " or IsNull(str) thenFilterHTML=" "Elsestr=Replace(str,">","&gt;";str=Replace(str,"<","&lt;";str=Replace(str,char(32)"&absp;";str=Replace(str,char(9),"&nbsp; 阅读全文
posted @ 2008-09-24 09:49 孤独的猫 阅读(219) 评论(0) 推荐(0) 编辑