Dragging And Dropping Frames
I Have This Code To Drag My Frame
VB Code:
Private Sub Frame4_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim OffsetX As Integer
Dim OffsetY As Integer
OffsetX = x
OffsetY = y
Frame4.Drag vbBeginDrag
End Sub
but that doesnt drop it
how do i drop the frame
1 Attachment(s)
Re: Dragging And Dropping Frames
You have to code the "drop" part as well.
See attachments.
Re: Dragging And Dropping Frames
Would modifying the method I suggested for a command button (here) work for you?
Cheers,
RyanJ
Re: Dragging And Dropping Frames
My standard code for moving controls:
VB Code:
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static ssngX As Single, ssngY As Single
If (Button = vbLeftButton) Then
Frame1.Move Frame1.Left + X - ssngX, Frame1.Top + Y - ssngY
Else
ssngX = X
ssngY = Y
End If
End Sub
Re: Dragging And Dropping Frames
Quote:
Originally Posted by penagate
My standard code for moving controls:
VB Code:
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static ssngX As Single, ssngY As Single
If (Button = vbLeftButton) Then
Frame1.Move Frame1.Left + X - ssngX, Frame1.Top + Y - ssngY
Else
ssngX = X
ssngY = Y
End If
End Sub
the top line of this code
VB Code:
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
gets the error
Compile Error: Procedure Declaration Does Not Match Description Of Event Or Procedure having the same name
Re: Dragging And Dropping Frames
:lol: It's exactly the same as the header of your code ;)
Just check you replaced Frame1 with the name of your Frame control.