在Form里用MouseMove中SetCapture(),计算mouse的位置,设置button和label的visible.就可以了。
20分太少了,否则就给你写个例子了。
20分太少了,否则就给你写个例子了。
解决方案 »
- 请教VBS调用COM组件时传参问题
- 我有1000个邮件地址,如何知道其中哪些邮件地址是无效的、或是已经作废的、或者根本发送不到的。
- 在excel中,要实现光标离开单元格触发一个事件,用vba如何实现?谢谢!
- DataGrid1显示数据 显示补了 帮忙看看 谢谢
- 如何一页只打一条一条记录
- VB怎么列举局域网上的SQL服务器名,像数据器连接配置一样?
- 请问如何在DataGrid里点击记录时另一个Text显示指定数据?
- 关于VB的MDI窗体的几个小问题(问题解决后立即给分)
- 关于SQLserver和vb不能不问的问题,也是大家迟早要问的问题!
- 紧急求救!菜鸟问题。请大侠们帮忙!!
- 请教!动态生成的控件怎样捕获click事件?
- 中国足球有黑哨,CSDN有人身攻击,乌烟瘴气的!
MouseDown、MouseUp、MouseMove。VB 似乎提供了很好的 Mouse 事件。但好象还缺少什么!对!还差 MouseExit(鼠标移出)事件。在 VB 中,我们要捕捉 MouseExit 事件,必须用 API 函数:
Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
然后,我们可以在控件(以 Picture1 为例)的 MouseMove 事件上加上以下代码:With Picture1 'Change this to the name of the control
If Button = 0 Then
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
原理和dbcontrols的一样.
谢谢大家啊