如题??
解决方案 »
- Raize 哪个控件可做成OutLookBar
- SendMessage的简单问题!!!
- 如何设计成绩查询系统
- 请问如何用delete from a.dbf 语句真正清空一个foxpro的数据库???
- 怎样不让用户直接看到access数据库中的内容
- 难得不累
- 在ttreeview中的onchick()事件中,怎样确定ttreeview中哪一个subitem被点击?
- Delphi高手请进,高分求救,只有这么多了,以后再给!
- cqiu2000(算死草)请进!
- 如何在程序中自动建立索引(paradox表)急!!!
- 有没有什么好方法设置TEdit控件的取值范围?
- 使用中如何初始化record,里面有几十个变量
function IsInObj(Handle:HWND):boolean;
var ms:TPOINT;wndRec:TRect;
begin
GetCursorPos(ms);
GetWindowRect(Handle ,wndRec);
Result:=(ms.X >wndRec.Left) and (ms.X <wndRec.Right)
and (ms.Y >wndRec.Top) and (ms.Y <wndRec.Bottom);
end;然后再 Timer的OnTimer事件中用IsInObj监测鼠标是否在指定窗口中。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type TYXFileListBox=Class(TFileListBox)
private
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
public
end;
var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var
yxflb:TYXFileListBox;
begin
yxflb:=TYXFileListBox.create(self);
yxflb.parent:=self
end;{ YXFileListBox }procedure TYXFileListBox.CMMouseLeave(var Message: TMessage);
begin
Form1.Caption:='mouse move out YXFileListBox';
end;
procedure TYXFileListBox.CMMouseEnter(var Message: TMessage);
begin
Form1.Caption:='mouse move in YXFileListBox';
end;end.
是可以了,但是它其它的事件怎么实现??
比如双击,单击 等事件??
但是太麻烦
你完全可以自己作一个控件
原理可以仿照其他带有onenter,ondbclick等事件的控件
自己作控件没什么难的
做了第一个,你就会发现很简单
看看TForm是怎么实现上面的功能的