鼠标在窗体上拉一下,得到拉的区域的长,宽,高是多少?
请各位高手指教一下!谢谢!
请各位高手指教一下!谢谢!
解决方案 »
- 求一数据控件
- ReportBuilder问题:如何用代码获取报表的数据源的sql语句,并根据需要修改
- 简体的字在繁体下如何显示?
- 保存路径的问题
- 类的实例化问题?
- 我在用ActiveX的TShockwaveFlash的时候,当改变窗体大小的时候,TShockwaveFlash却不能………
- 有没有自定义的表格控件呀
- 谁有VB中的Richtx32.ocx发到我邮箱[email protected]
- 请问怎样对某个目录设定口令或加密,50分
- 有谁有压缩算法?谢谢。
- 寻人masks1,blazingfire,Hank,snake_eye,SQL5560,thx1180,yangjingyu
- 菜鸟问题 关于重命名
mousedown记录起始点
mouseup记录结束点
这两个点即可以确定一个区域
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
x1,y1:integer;implementation{$R *.dfm}procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
x1:=x;
y1:=y;
end;procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
label1.Caption:=inttostr(x-x1);
label2.Caption:=inttostr(y-y1);
end;end.