|
-
Jun 30th, 2005, 03:27 PM
#1
Thread Starter
Lively Member
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
-
Jun 30th, 2005, 03:54 PM
#2
Re: Dragging And Dropping Frames
You have to code the "drop" part as well.
See attachments.
-
Jun 30th, 2005, 03:57 PM
#3
Re: Dragging And Dropping Frames
Would modifying the method I suggested for a command button (here) work for you?
Cheers,
RyanJ
-
Jun 30th, 2005, 09:25 PM
#4
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
-
Jul 1st, 2005, 05:20 AM
#5
Thread Starter
Lively Member
Re: Dragging And Dropping Frames
 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
-
Jul 1st, 2005, 05:23 AM
#6
Re: Dragging And Dropping Frames
It's exactly the same as the header of your code 
Just check you replaced Frame1 with the name of your Frame control.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|