社区
Delphi
帖子详情
焦点问题
xiaoli2200
2003-10-20 11:14:10
我想实现这样一个东东
比如shape控件,我想把鼠标移上去时就变色,移开时恢复,原来我是在MOUSEMOVE中做的,移开时在别的控件写,把它变回来,但有缺陷,因为移到FORM外就不行了,请问有什么好方法,谢谢
...全文
62
7
打赏
收藏
焦点问题
我想实现这样一个东东 比如shape控件,我想把鼠标移上去时就变色,移开时恢复,原来我是在MOUSEMOVE中做的,移开时在别的控件写,把它变回来,但有缺陷,因为移到FORM外就不行了,请问有什么好方法,谢谢
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zhp97
2003-10-22
打赏
举报
回复
有一个苯办法,你取得该应用程序窗口在屏幕上的坐标,随时与鼠标即时坐标做比较,如果鼠标在窗口之外就恢复颜色啊!!!取屏幕坐标好象有现成函数可用,不必自己写。
zzh54zzh
2003-10-22
打赏
举报
回复
这个方法可能有些笨,不过我测试过了,符合你的要求:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
Timer2: TTimer;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Type
TShape1 =class (TShape)
private
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
end;
var
Form1: TForm1;
Shape1: TShape1;
implementation
{$R *.dfm}
{ TShape1 }
procedure TShape1.CMMouseEnter(var Message: TMessage);
begin
Form1.Timer1.Enabled := True;
Form1.Timer2.Enabled := False;
end;
procedure TShape1.CMMouseLeave(var Message: TMessage);
begin
Form1.Timer1.Enabled := False;
Form1.Timer2.Enabled := True;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Shape1 := TShape1.Create(Form1);
Shape1.Parent := Form1;
Shape1.Align := alClient;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Shape1.Free;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if Shape1.Pen.Style <> psSolid then
Shape1.Pen.Style := psSolid;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
if Shape1.Pen.Style <> psClear then
Shape1.Pen.Style := psClear;
end;
end.
zzh54zzh
2003-10-22
打赏
举报
回复
先看看这个
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Type
TShape1 =class (TShape)
private
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
end;
var
Form1: TForm1;
Shape1: TShape1;
implementation
{$R *.dfm}
{ TShape1 }
procedure TShape1.CMMouseEnter(var Message: TMessage);
begin
Form1.Caption := 'Y';
end;
procedure TShape1.CMMouseLeave(var Message: TMessage);
begin
Form1.Caption := 'N';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Shape1 := TShape1.Create(Form1);
Shape1.Parent := Form1;
Shape1.Align := alClient;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Shape1.Free;
end;
end.
gx
2003-10-21
打赏
举报
回复
gz
xiaoli2200
2003-10-21
打赏
举报
回复
意思是这样,怎么样得到光标在某个控件上,或者怎么样得到光标已经离开这个控件
Alanwn
2003-10-21
打赏
举报
回复
用图片试试好不
herofy
2003-10-21
打赏
举报
回复
我只知道用消息
Win7系统的电脑变成wifi网
#### 四、常见
问题
及解决方案 - **无法看到虚拟WiFi网卡**:请检查无线网卡驱动是否已经更新,或者尝试重新安装无线网卡驱动。 - **其他设备无法连接**:请确保WiFi热点的名称和密码正确无误,并检查防火墙设置是否...
解决高并发项目下的热点
问题
1.什么是热点 点表示我们在系统的业务路径上有一个地方存在性能的瓶颈,比如数据库,件系统,网络,甚至于内存等,这个点一般有io,锁等
问题
构成...其次我们需要弄清楚我们的热点
问题
是属于读热点
问题
还是写热点
问题
,
Scrollview嵌套Listview 或者gridview
焦点
问题
1,有的时候我们需要通过scrollview嵌套listview 或者gridview 当然 scrollview 上还有其他的UI控件,(button textview imageview 等 如果没有这些 东西我们也不用 去嵌套这些东西了 )主要说的是
焦点
问题
什么意思...
数据库热点
问题
的产生和避免
数据库的排序内存,哈希内存空间,有的数据库使用一个参数控制,有的数据库使用不同的参数控制,这个内存也非常...数据库热点
问题
和交通阻塞特别的像,当没有发生时,一切正常,发生之后,系统的吞吐量会急剧的下降。
hbase热点
问题
排查及处理
Hbase shell执行切分region命令,会把原先1个region切分为2个region,切分完成后再执行合并的动作, 可以暂时缓解region热点
问题
。4.重启regionserver(看某个regionserver是否读写明显超其他regionserve,如有该情况...
Delphi
5,943
社区成员
262,943
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章