如果用API,你可以使用钩子
如果不想用API,你可以在它下面放一个略大一点的PictureBox,使用它们的MouseMove来判断
如果不想用API,你可以在它下面放一个略大一点的PictureBox,使用它们的MouseMove来判断
解决方案 »
- 通过WebBrowser能控制 window.showModalDialog生成的网页对话框吗?
- 设置Adodc控件属性(非代码状态下)时,能不能设置数据库相对路径
- 跪求 run.exe "hello world" 实现
- 菜鸟的问题:怎样将数据表最后一条纪录的自动编号取出来??
- 网站管理问题
- 求算法!急!大虾帮忙,应该不是很难
- dll的问题。
- listbox可以加横向滚动条吗?
- winsock问题???
- 100分奉送!各位同仁,你们在公司的做软件提成有多少?
- 我为什么不能添加ActiveX控件中的Sheridan 3D Controls(三维)控件?
- 怎样把写入text.text的内容显示出来
Public Declare Function ReleaseCapture Lib "user32" () As Long
这种方法不好,有时,鼠标移快了。MouseMove事件不触发。就用 victorfen(小B) 说的两个API吧。Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
With PicShow 'Change this to the name of the control
If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
'Mouse pointer is outside button, so let other controls receive
'mouseevents too:
ReleaseCapture
' 放入鼠标离开的代码
Else
' Mouse pointer is over button, so we'll capture it, thus
' we'll receive mouse messages even if the mouse pointer is
' not over the button
SetCapture .hwnd
' 放入鼠标进入的代码
End If
End With
End Sub
http://www.dahpa.net/bbs
中有完整的检测鼠标的离子!