如何实现鼠标移上和移开导致两幅不同的图象? 在界面设计时,有一位图或按扭,当鼠标放上去后 该按扭(或图象)变亮,当鼠标移开时,变暗,试问高手,如何实现? 请高手指点,先谢了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 现在如一幅图,用作鼠标未移入时的状态,再在按钮的mousemove()中载入另一幅! 设置变量BOOL m_bInButtonRect;//判断是否鼠标处于按钮上得到按钮的矩形坐标m_bnButton.GetWindowRect(&m_rtButton); //CRect m_rtButton响应WM_MOUSEMOVE{ POINT pt; GetCurPoint(&pt); if(m_rtButton.PtInRect(pt)) { 按钮变亮; ..... } else { 。 } 在此你可以看到合适的例子:http://www.vckbase.com/code/listcode.asp?mclsid=3&sclsid=301 谢谢各位的发言。to andy_lau(天行键,君子当自强不息!) :在你的代码中,出现如下错误:{ POINT pt; GetCurPoint(&pt); //error ; if(m_rtButton.PtInRect(pt)) { 按钮变亮; ..... } else { 。 } error 错误如下:C2065: 'GetCurPoint' : undeclared identifier;怎么解决? CString写入到char[].HELP! 当MoveWindow一个Dialog后,再使另一个Dialog DoModal后,Domodal的Dialog总是被隐藏 在控件中创建的无模式对话框,上面的按钮在获得焦点后自动变为默认按钮! (没分了 各位好心人帮帮忙啊)关于对象之间传递指针的问题?这样做是否非法? 网络层截包,修改再转发 基础: win32应用程序 MFC 支持 看看我这个读ini的程序怎么读出来一堆乱码? 关于ADO在98下面的奇怪问题. “一个参数传递的问题”请求帮帮忙! 动态拓扑图 按钮问题 为什么不显示
得到按钮的矩形坐标m_bnButton.GetWindowRect(&m_rtButton); //CRect m_rtButton
响应WM_MOUSEMOVE
{
POINT pt;
GetCurPoint(&pt);
if(m_rtButton.PtInRect(pt))
{
按钮变亮;
.....
}
else
{
。
}
http://www.vckbase.com/code/listcode.asp?mclsid=3&sclsid=301
{
POINT pt;
GetCurPoint(&pt); //error ;
if(m_rtButton.PtInRect(pt))
{
按钮变亮;
.....
}
else
{
。
} error 错误如下:
C2065: 'GetCurPoint' : undeclared identifier;怎么解决?