private
anobject:tobject;
procedure cmmouseenter(var msg:tmessage); message cm_mouseenter;
procedure cmmouseleave(var msg:tmessage); message cm_mouseleave;procedure tcontrolface1.cmmouseenter(var msg:tmessage);
begin
anobject:=tobject(msg.LParam);
if anobject<>nil then
if (anobject.ClassType=tpanel) then
begin
tpanel(anobject).BevelInner:=bvraised;
tpanel(anobject).Color:=clyellow;
end;
end;procedure tcontrolface1.cmmouseleave(var msg:tmessage);
begin
anobject:=tobject(msg.LParam);
if anobject<>nil then
if (anobject.ClassType=tpanel) then
begin
tpanel(anobject).BevelInner:=bvnone;
tpanel(anobject).Color:=clmoneygreen;
end;
end; 在窗口在放几个tpanel,和一个tgroupbox. 如果把tpanel放在窗体里,鼠标移到tpanel上有反应(tpanel变成黄色).而如果把tpanel放在tgroupbox里,则鼠标移到tpanel上就没反应了(tpanel不变色),这是为什么.如何才能让它有反应呢.
anobject:tobject;
procedure cmmouseenter(var msg:tmessage); message cm_mouseenter;
procedure cmmouseleave(var msg:tmessage); message cm_mouseleave;procedure tcontrolface1.cmmouseenter(var msg:tmessage);
begin
anobject:=tobject(msg.LParam);
if anobject<>nil then
if (anobject.ClassType=tpanel) then
begin
tpanel(anobject).BevelInner:=bvraised;
tpanel(anobject).Color:=clyellow;
end;
end;procedure tcontrolface1.cmmouseleave(var msg:tmessage);
begin
anobject:=tobject(msg.LParam);
if anobject<>nil then
if (anobject.ClassType=tpanel) then
begin
tpanel(anobject).BevelInner:=bvnone;
tpanel(anobject).Color:=clmoneygreen;
end;
end; 在窗口在放几个tpanel,和一个tgroupbox. 如果把tpanel放在窗体里,鼠标移到tpanel上有反应(tpanel变成黄色).而如果把tpanel放在tgroupbox里,则鼠标移到tpanel上就没反应了(tpanel不变色),这是为什么.如何才能让它有反应呢.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货