⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_53078.htm

📁 vc
💻 HTM
字号:
<p>
序号:53078 发表者:hls 发表日期:2003-09-17 09:57:37
<br>主题:鼠标 十字
<br>内容:我用鼠标会只“十字”,代码如下<BR><BR>void CVpView::OnMouseMove(UINT nFlags, CPoint point) <BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;CRect rect;<BR>&nbsp;&nbsp;GetClientRect(&amp;rect);<BR>&nbsp;&nbsp;CClientDC* pDC = new CClientDC(this);&nbsp;&nbsp; <BR>&nbsp;&nbsp;nOldMode= pDC-&gt;GetROP2();<BR>&nbsp;&nbsp;pDC-&gt;SetROP2(R2_NOT);<BR>&nbsp;&nbsp;pDC-&gt;MoveTo(0,Anchor.y);<BR>&nbsp;&nbsp;pDC-&gt;LineTo(rect.Width(),Anchor.y);<BR>&nbsp;&nbsp;pDC-&gt;MoveTo(Anchor.x,0);<BR>&nbsp;&nbsp;pDC-&gt;LineTo(Anchor.x,rect.Height());<BR> <BR>&nbsp;&nbsp; pDC-&gt;MoveTo(0,point.y);<BR>&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;LineTo(rect.Width(),point.y);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;MoveTo(point.x,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;LineTo(point.x,rect.Height());<BR> <BR>&nbsp;&nbsp;Anchor.x=point.x;<BR>&nbsp;&nbsp;Anchor.y=point.y;<BR>&nbsp;&nbsp;pDC-&gt;SetROP2(nOldMode); <BR>delete&nbsp;&nbsp;pDC; <BR>CView::OnMouseMove(nFlags, point);<BR>}<BR>请教:如何教鼠标第一次进入客户区市所绘的“十字”擦除;另外鼠标从客户区出去怎样擦除出客户区前的最后一点的“十字”?<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:iamhere 回复日期:2003-09-17 10:08:20
<br>内容:可以处理WM_MOUSEHOVER(鼠标第一次进入)和WM_MOUSELEAVE(鼠标离开)消息
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:hls 回复日期:2003-09-18 10:59:14
<br>内容:再帮个忙,如何获得鼠标第一次进入客户区时的坐标 ?&nbsp;&nbsp;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:iamhere 回复日期:2003-09-18 11:57:36
<br>内容:WM_MOUSEHOVER消息中的LPARAM参数含义如下:<BR>lParam <BR>The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area. <BR>The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area. <BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:hls 回复日期:2003-09-18 15:28:04
<br>内容: 谢谢!可以告诉我 OnMouseEnter&nbsp;&nbsp;怎么用吗?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:iamhere 回复日期:2003-09-18 15:39:22
<br>内容:OnMouseEnter???这是什么东东?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:hls 回复日期:2003-09-18 15:42:41
<br>内容:The OnMouseEnter method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.<BR><BR>Notes to Inheritors:&nbsp;&nbsp;When overriding OnMouseEnter in a derived class, be sure to call the base class's OnMouseEnter method so that registered delegates receive the event.<BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -