摘要:在应用程序的开发中,常常要将某些控件对象(如标签)用鼠标选中后进行拖动操作,用以改变控件的位置,在delphi中如何实现这一功能呢?笔者想了一个方法:通过在 public 中定义全局变量用以跟踪 鼠标在移动和拖动控件时的坐标,然后在拖动结束时将鼠标的坐标值赋给控件的 top和left属性,以达到拖动的目的。
举例如下:创建一个 panel,再创建一个label,通过编程使控件 lable 可......
摘要:single, double和extended型的浮点变量存在着四舍五入问题。举个例子,假设我们用电脑使用4位数字,那么:
1 / 3 = 0.3333
我们知道3 * 1/3 = 1,但如果我们这样:
x := 1 / 3;
x := x * 3;
if x = 1 then //结果将会不正确
为什么?因为x = 0.9999而不是1。
电脑不会有无限的小数位。从s......
将hint显示在StatusBar1上我们为了将hint显示在statusbar1上需要如下方法
public 【程序编程相关:
ReportBuilder设置打印页范围】 【推荐阅读:
在TWebBrowser 屏蔽右键的弹出】
procedure displayhint(sender: tobject); 【扩展信息:
Delphi7程序中上下文关联chm帮助】
end;
var
form1: tform1;
implementation
{$r *.dfm}
{ here is the implementation of the onhint event handler }
{ it displays the application抯 current hint in the status bar }
procedure tform1.displayhint(sender: tobject);
begin ...
下一页 摘要: procedure parkdisk;
var regs: registers;
begin
regs.al := $00;
intr($13,regs);
assert((regs.flags and fcarry) = 0,
error getting disk parameters - al returns +inttostr (regs.al,0));
reg......