注意显示申明!Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Static s as Long,t as long
s = Not 1 t = Not 1 If t And s Then z = SetParent(Command1.hWnd, ByVal Picture2.hWnd)
Else z = SetParent(Command1.hWnd, ByVal Picture1.hWnd) End If
End Sub
http://expert.csdn.net/Expert/topic/1138/1138210.xml?temp=.512005 老大,按钮 移动到,picture2后,还是移动不回来。怎么回师/ 在你机子 上 能么? 我的怎么不能? Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Static s As Long, t As Long
s = Not 1 t = Not 1 If t And s Then z = SetParent(Command1.hWnd, ByVal Picture2.hWnd)
Else z = SetParent(Command1.hWnd, ByVal Picture1.hWnd) End If
谁叫你照抄 我只是写了一个思路 Private t as BooleanPrivate Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Static s as Boolean
if t=False then Exit Sub
s = Not s If s Then z = SetParent(Command1.hWnd, ByVal Picture2.hWnd) Else z = SetParent(Command1.hWnd, ByVal Picture1.hWnd) End If
End Sub
Option ExplicitPrivate Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Dim bPos As Boolean, zPrivate Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If bPos Then z = SetParent(Command1.hWnd, ByVal Picture2.hWnd) Else z = SetParent(Command1.hWnd, ByVal Picture1.hWnd) End If Command1.Move 200, 200 bPos = Not bPos End Sub
http://expert.csdn.net/Expert/topic/1138/1138210.xml?temp=.2150385鎴戞槸璇达紝榧犳爣绉诲姩鍒?pictur1涓殑commond1璺戦亾picture2鍚庯紝褰撻紶鏍囩Щ鍔ㄥ埌 pictur2涓殑commond1杩樿兘璺戦亾picture1//濡備綍瀹炵幇锛焭[email protected]
http://expert.csdn.net/Expert/topic/1138/1138210.xml?temp=.2150385我是说,鼠标移动到 pictur1中的commond1跑道picture2后,当鼠标移动到 pictur2中的commond1还能跑道picture1//如何实现?[email protected]
Static s as Long,t as long
s = Not 1
t = Not 1
If t And s Then
z = SetParent(Command1.hWnd, ByVal Picture2.hWnd)
Else z = SetParent(Command1.hWnd, ByVal Picture1.hWnd)
End If
End Sub
老大,按钮 移动到,picture2后,还是移动不回来。怎么回师/
在你机子 上 能么?
我的怎么不能?
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static s As Long, t As Long
s = Not 1
t = Not 1
If t And s Then
z = SetParent(Command1.hWnd, ByVal Picture2.hWnd)
Else z = SetParent(Command1.hWnd, ByVal Picture1.hWnd)
End If
End Sub谢谢 了 。/[email protected]
我只是写了一个思路
Private t as BooleanPrivate Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static s as Boolean
if t=False then Exit Sub
s = Not s
If s Then
z = SetParent(Command1.hWnd, ByVal Picture2.hWnd)
Else
z = SetParent(Command1.hWnd, ByVal Picture1.hWnd)
End If
End Sub
Dim bPos As Boolean, zPrivate Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If bPos Then
z = SetParent(Command1.hWnd, ByVal Picture2.hWnd)
Else
z = SetParent(Command1.hWnd, ByVal Picture1.hWnd)
End If
Command1.Move 200, 200
bPos = Not bPos
End Sub