3837.html

来自「VB技巧问答10000例,是一个教程」· HTML 代码 · 共 23 行

HTML
23
字号
<html>
  <head>
    <title>Code to Capture Mouse_Exit</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>Code to Capture Mouse_Exit</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by <a href="mailto:wangkai@nease.net">kingkong</a> on July 12, 1998 at 16:12:57:<p>
In Reply to: <a href="3826.html">请问如何 当mouse 移到 按钮上时有浮动的效果!</a> posted by 阿忠 on July 12, 1998 at 00:25:17:<p>
Use this code to capture Mouse_exit:<br>Writen in Chinese GB code and from:<br>http://www.nease.net/~jackyyin<br>====================================<p>Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long<br>Private Declare Function ReleaseCapture Lib "user32" () As Long <br>然后,我&#20204;可以在控件(以 Picture1 &#20026;例)的 MouseMove 事件上加上以下代&#30721;: <br>    Dim MouseExit As Boolean<br>    MouseExit = (0 <= X) And (X <= Picture1.Width) And (0 <= Y) And (Y <= Picture1.Height)<br>    If MouseExit Then<br>       ' do somthing<br>        SetCapture Picture1.hWnd<br>    Else<br>       ' do songthing<br>        ReleaseCapture<br>    End If <br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 3837-->
</ul><!--end: 3837-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

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