摘要:在dbgrid的ondrawdatacell事件下写:
procedure tform1.dbgrid1drawdatacell(sender: tobject; const rect: trect;
field: tfield; state: tgriddrawstate);
begin
if table1.fieldbyname(partno).asfloat > 2500 ......
摘要:delphi是inprise(前borland)公司的优秀的可视化编程工具,它自带的mediaplayer控件是开发多媒体的利器。用它几分钟就可以做出一个象解霸一样可以播放多媒体文件的程序来。但可能很少人知道,用它也可以做一个录音程序。
运行delphi,在system页拖一个mediaplayer控件到窗体上,默认名为mediaplayer1。由于我们的程序是采用自己的按钮,所以将media......
自制THyperLink组件成都市八二信箱 王乐
【程序编程相关:
Delphi的RSS开源项目正式启动了!】 【推荐阅读:
如何制作照片底片效果的图像(即反色)
】
很多软件在其about窗口或help菜单中,可让用户通过单击一段文字就能方便地访问某个网页.比如,delphi的help中就有可直接访问该公司主页的菜单项.下面介绍的thyperlink组件是用delphi3.0编制的,可方便地实现上述功能. 【扩展信息:
将DBGrid 当前列定位到指定的字段上】
thyperlink是基于tcustomlabel组件的,它有以下特性:
属性:
普通label组件的所有特性,考滤到实际用途只公布了caption.color. cursor. enabled. font. hint. showhint. visible等属性,其中font属性在构造函数中被初始化为蓝色带下划线字体,cursor被置为手型鼠标.别外,增加了url属性用于存贮网址.在组件内部接管了onclick事件,用于实现用户单击后调用默认浏览器打开url中指定的网页,处理各种错误,并将font属性置为紫色.
方法:
function browse(aurl: string): integer;
{ aurl为网址或文件名.}
事件:
onclick; { 响应用户鼠标单击动作. }
具体源码如下:
{ thyperlink vcl, version 1.0
this is freeware. if you make cool changes to it,
please send them to me(1234@5678.com).
}
unit hyperlink;
interface
uses
windows, messages, sysutils, classes,
graphics, controls, forms, dialogs,
shellapi, stdctrls;
type
thyperlink = class(tcustomlabel)
private
furl: string; // 存贮网址或文件名 ...
下一页 摘要:假设我们要将某个结点treenode移动到另一结点anitem上并做为anitem的child,按照文档说明,只需这样做
treenode.moveto(anitem,nraddchild);
但实际上,在delphi 4中,假如anode原来没有child的话,这条语句将不做任何事情。折衷的办法是
tempnode:=topictv.items.addchild(anitem,);
tre......