摘要:在应用程序的开发中,常常要将某些控件对象(如标签)用鼠标选中后进行拖动操作,用以改变控件的位置,在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上上一页 ...
statusbar1.simpletext := application.hint;
end; 【程序编程相关:
ReportBuilder设置打印页范围】 【推荐阅读:
在TWebBrowser 屏蔽右键的弹出】
【扩展信息:
Delphi7程序中上下文关联chm帮助】
{ here is the form抯 oncreate event handler. }
{ it assign抯 the application抯 onhint event handler at runtime }
{ because the application is not available in the object inspector }
{ at design time }
procedure tform1.formcreate(sender: tobject);
begin
application.onhint := displayhint;
end;
其实只需要将
statusbar1.autohint:=true
即可完成
摘要: 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......