没办法,我只有再开一个贴子了,高手请进。。 现想实现 当把鼠标放在dbgrid控件得标题栏时,鼠标形状变成一个小手。其他环境下不变。翻阅过资料,是不是得调用消息,句柄 啊。菜鸟不会,还请指教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的理解:mouseover事件光标改变 前两种方法我都是试过了。都只是对dbgrid控件来实现。这是个历史遗留问题啊。我查过csdn有过这方面得帖子,但都没有解决。请楼主关注!! 有个不用消息的办法,在OnMouseMove里判断如当前坐标在纵坐标在DBGrid1.ClientRect.Top和DBGrid1.ClientRect.Bottom之间Cursor为缺省值,否则Cursor:=crHandPointdbgrid的标题的高度(DBGrid1.ClientRect.Bottom-DBGrid1.ClientRect.Top) 能不能用一个panel之类的把title盖住,大小,颜色,caption都和title一致 inforum(坛中人,来捧个场!) 的应该可行! procedure TForm1.DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);begin if (x >=DBGrid1.ClientRect.Top) and (x<= DBGrid1.ClientRect.Bottom) then cursor := crHandPoint else cursor := crDefault;end;我试了,有一点点误差 大概思路是对得。但是DBGrid1.ClientRect.Top 和DBGrid1.ClientRect.Bottom 两者差值不是标题栏得宽度?鼠标得变化还在整个query件上 Sorry,标题栏的高度应是:DBGrid1.Height-(DBGrid1.ClientRect.Bottom-DBGrid1.ClientRect.Top) 问题倒是解决了,但是我使用了一种土办法,给标题y轴定制了高度。procedure TFrm_Interface.DBG_UserMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);begin if (x >=DBG_User.ClientRect.Top) and (x <= DBG_User.ClientRect.Bottom) and (y >=DBG_User.ClientRect.Top) and (y<= 20)then dbg_user.cursor := crHandPoint else dbg_user.cursor := crDefault;end; procedure TFrm_Interface.DBG_InterMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);var y_winth:integer;begin y_winth:=DBG_inter.Height-(DBG_inter.ClientRect.Bottom-DBG_inter.ClientRect.Top);//标题栏得高度 if (x >=DBG_inter.ClientRect.Top) and (x <= DBG_inter.ClientRect.Bottom) and (y >=DBG_inter.ClientRect.Top) and (y<= y_winth)then dbg_inter.cursor := crHandPoint else dbg_inter.cursor := crDefault;end;inforum(坛中人,来捧个场!) 可以接分了 有字符串“AB#¥·中国adff()”,怎么样区分这些字符串中是不是有汉字? WebBrowser如何得到一个html文件的原代码啊 有没有谁能回答一个问题 query问题 在线等待 新手请教 下列语句运行时为何不报错(intraweb) 帮助文件的制作 StringGird的两个小问题. dbchart显示数据库表的问题 delphi中调用Winrar后怎样等待其解压完成后再向下执行? 各位老大帮偶看看这段代码,谢谢,出错提示:stack overflow 一个简单的Access2000问题,在线等。。。。 请教一个可能是很简单的问题?
我的理解:
mouseover事件
光标改变
都只是对dbgrid控件来实现。
这是个历史遗留问题啊。我查过csdn有过这方面得帖子,但都没有解决。
请楼主关注!!
在OnMouseMove里判断如当前坐标在纵坐标在DBGrid1.ClientRect.Top和DBGrid1.ClientRect.Bottom之间Cursor为缺省值,否则Cursor:=crHandPointdbgrid的标题的高度(DBGrid1.ClientRect.Bottom-DBGrid1.ClientRect.Top)
Y: Integer);
begin
if (x >=DBGrid1.ClientRect.Top) and (x<= DBGrid1.ClientRect.Bottom) then
cursor := crHandPoint
else
cursor := crDefault;end;
我试了,有一点点误差
但是DBGrid1.ClientRect.Top 和DBGrid1.ClientRect.Bottom 两者差值不是标题栏得宽度?
鼠标得变化还在整个query件上
DBGrid1.Height-(DBGrid1.ClientRect.Bottom-DBGrid1.ClientRect.Top)
Shift: TShiftState; X, Y: Integer);
begin if (x >=DBG_User.ClientRect.Top) and (x <= DBG_User.ClientRect.Bottom) and (y >=DBG_User.ClientRect.Top) and (y<= 20)then
dbg_user.cursor := crHandPoint
else
dbg_user.cursor := crDefault;
end;
Shift: TShiftState; X, Y: Integer);
var
y_winth:integer;
begin
y_winth:=DBG_inter.Height-(DBG_inter.ClientRect.Bottom-DBG_inter.ClientRect.Top);//标题栏得高度
if (x >=DBG_inter.ClientRect.Top) and (x <= DBG_inter.ClientRect.Bottom) and (y >=DBG_inter.ClientRect.Top) and (y<= y_winth)then
dbg_inter.cursor := crHandPoint
else
dbg_inter.cursor := crDefault;
end;
inforum(坛中人,来捧个场!) 可以接分了