摘要: Delphi 中Sender对象的定义!1.Sender的定义:每一个事件处理里面至少都有一个Sender参数。比如:procedure TForm1.Button1Click(Sender:TObject);begin...end;Sender的含义就是代表调用TForm1.Button1Click这个过程的控件. 由于Sender是TObject,所以任何object都可以赋给Sender.当你点击BUTTON1时,会产生一个Button1Click事件,系统会把Button1传递给Button1Click过程坐为参数,也就是所说的Sender.2.Sender的用法:.由于Sender代 阅读全文
posted @ 2010-11-01 14:24 linux,dev 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 检举|2010-05-08 09:41你的样子20 | 分类:其他编程语言 | 浏览6314次怎样产生随机数 条件是 1.这些随机数每个都不同(5个数吧) 2.随机数的范围在1到35之间 我要把他们显示在 memo1 中 怎么显示呢 谢谢大侠们了 回答好了 加 50procedure TForm1.Button1Click(Sender:TObject);vars:string;beginRandomize;Memo1.Lines.Clear;while Memo1.Lines.Count<5 do begins := IntToStr(Random(35)+1);if Memo1.Li 阅读全文
posted @ 2010-11-01 14:24 linux,dev 阅读(663) 评论(0) 推荐(0) 编辑
摘要: varNum:integer;beginRandomize;//初始化随机种子Num:=random(10); //随机10以内的数字showmessage(Inttostr(Num));end; 阅读全文
posted @ 2010-11-01 14:23 linux,dev 阅读(827) 评论(0) 推荐(0) 编辑
摘要: uses SysUtils;//先使用function Now: TDateTime;//返回当前年月日和时间//然后使用function FormatDateTime(const Format: string; DateTime: TDateTime): string;//输出你所需要的任何格式的时间字符串//应用:varsMonth : String;sTime: String;sMonth := FormatDateTime('mm', Now); //你所需要的sTime := FormatDateTime('yyyy-mm-dd, hh:nn:ss', 阅读全文
posted @ 2010-11-01 14:22 linux,dev 阅读(950) 评论(0) 推荐(0) 编辑
摘要: delphi的字符截取函数LeftStr, MidStr, RightStr这几个函数都包含在StrUtils中,所以需要uses StrUtils;假设字符串是 Dstr := ’Delphi is the BEST’, 那么LeftStr(Dstr, 5) := ’Delph’MidStr(Dstr, 6, 7) := ’i is th’RightStr(Dstr, 6) := ’e BEST’~~~~~~~~~~~~~~~~~~~~~~~~~function RightStr(Const Str: String; Size: Word): String;beginif Size > 阅读全文
posted @ 2010-11-01 14:22 linux,dev 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 我在线程中对TBitmap进行绘制时,发现有微小的机率绘制出现问题,出现问题的bitmap绘制结果是白色的。绘制方法是Canvas.Draw, 我又试了Bitblt(bmp.Canvas.Handle...)这种方式,同样也有问题。但在主线程中不会出现这种情况。还有TBitmap.Canvas.Pixels方法,在线程中也有问题,这个机率较大些,具体过程如下:1. 在线程中创建一TBitmap,加载一个PixelFormat = pf1bit的位图(也就是通常黑白两色的mask)2. 循环用TBitmap.Canvas.Pixels取出各点的颜色值,你会发现,取出的值有可能不等于clBlack 阅读全文
posted @ 2010-11-01 14:21 linux,dev 阅读(395) 评论(0) 推荐(0) 编辑
摘要: * 功能: 截取屏幕中的指定区域 ** 输入参数: ** LeftPos :左坐标 ** TopPos :上坐标 ** RightPos:右坐标 ** BottomPos :底部坐标 ** author : liubin ** datetime : 2010-10-01 ***********************************}procedure ScreenCap(LeftPos,TopPos,RightPos,BottomPos:integer);var RectWidth,RectHeight:integer; SourceDC,DestDC... 阅读全文
posted @ 2010-11-01 14:21 linux,dev 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 回复于: 2004-09-18 09:29:21FormStyle:=fsStayOnTop回复于: 2004-09-19 16:44:551.截住wm_windowposchanging消息。修改为:procedure wmwinposchange(Var message:tmessage);varp:windowposbeginp:=windowpos(pointer(message.lparam)^)if p.hwndafter...=hwnd_topmost theninherited;end;2. in form.create event write setwindowpos use 阅读全文
posted @ 2010-11-01 14:20 linux,dev 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 发布时间:2008-04-02 17:11:04 来源:编程爱好者网站 作者:编程爱好者网站 点击:298 在 开 发 证 券 分 析 软 件 中, 经 常 要 绘 制 各 种 股 票 的 分 析 曲 线。 为 了 使 得 软件 的 功 能 更 加 方 便. 灵 活, 用 户 希 望 能 够 按 照 自 己 的 喜 好 自 定 义 各 种 曲 线 的颜 色。 在 W O R DArray7 的[ 格 式] 菜 单 下 的 字 体 对 话 框 中 有 类 似 的 功 能。 当 用 户单 击 字 体 对 话 框 中 的 颜 色 下 拉 框 时, 各 种 颜 色 的 简 单 图 案 和 字 体 的. 阅读全文
posted @ 2010-11-01 14:20 linux,dev 阅读(484) 评论(0) 推荐(0) 编辑
摘要: 1 楼Gold2000(Gold2000)回复于 2006-02-27 09:44:57实现点击ComboBox(DBComboBox)按钮下拉出现MonthCalendar效果 unit LMS_DBComboBox_Date; interface uses Variants, Windows, SysUtils, Messages, Controls, Forms, Classes,VDBConsts,DateUtils, Graphics, Menus, StdCtrls, ExtCtrls, Mask, Buttons, ComCt... 阅读全文
posted @ 2010-11-01 14:19 linux,dev 阅读(520) 评论(0) 推荐(0) 编辑
摘要: 本例效果图:代码文件:unit Unit1;iinterfaceuuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ImgList, ComCtrls;ttype TForm1 = class(TForm) ComboBox1: TComboBox; ImageList1: TImageList; //你先要有图标 procedure FormCreate(Sender: TObject); procedure ComboBox1DrawI... 阅读全文
posted @ 2010-11-01 14:19 linux,dev 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 回复于: 2004-07-22 21:50:55给你专门写了个,怎么样?unit myedit;interfaceuses Windows, SysUtils, Classes, ComCtrls,forms,Controls, ExtCtrls,StdCtrls,Buttons,Graphics;typeTMyButton = class(TSpeedbutton)privateprotected procedure Paint; override;publicend; TMyEdit = class(TCustomEdit) private protected published pro. 阅读全文
posted @ 2010-11-01 14:18 linux,dev 阅读(250) 评论(0) 推荐(0) 编辑
摘要: function GetFileName(FileName: string): string; {从路径中分离文件名}var Contador: integer;beginContador := 1;while Copy(FileName, Length(FileName) - Contador, 1) '\' dobeginContador := Contador + 1;end;Result := (Copy(FileName, Length(FileName) - Contador + 1, Length(FileName)));end; 阅读全文
posted @ 2010-11-01 14:17 linux,dev 阅读(301) 评论(0) 推荐(0) 编辑