看来只能用标准控件模拟了。
另一个相关的问题:如果用label 控件模拟,当鼠标移动到label上时,label的形状改变(就像菜单那样),我用form_mouseMove()事件来做,发现当鼠标真正移动到label内时,在这个事件里根本不能得到x,y (移到其它控件上也是一样)。当在label_MouseMove()事件里时,又不能检测到鼠标移出。要是VB里有MOuseOver()事件就好了。
PS:mouseOver事件已解决。如下
Private Declare Function SetCapture Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim mouseOver As Boolean
mouseOver = (X > 0 And X < Picture1.Width) And (Y > 0 And Y < Picture1.Height)
If mouseOver Then
SetCapture Picture1.hWnd
Picture1.BorderStyle = 1
Else
ReleaseCapture
Picture1.BorderStyle = 0
End If
End Sub
[ 本帖最后由 只爱陌生人 于 2006-10-5 22:14 编辑 ]