Private IsFormBeingDragged As Boolean = False
Private MouseDownX As Integer
Private MouseDownY As Integer
Private Sub AxShockwaveFlash1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles AxShockwaveFlash1.MouseDown
If CustomizeMode = True Then
If e.Button = MouseButtons.Left Then
IsFormBeingDragged = True
MouseDownX = e.X
MouseDownY = e.Y
End If
End If
End Sub
Private Sub AxShockwaveFlash1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles AxShockwaveFlash1.MouseMove
If CustomizeMode = True Then
If IsFormBeingDragged Then
Dim temp As Point = New Point()
temp.X = AxShockwaveFlash1.Location.X + (e.X - MouseDownX)
temp.Y = AxShockwaveFlash1.Location.Y + (e.Y - MouseDownY)
AxShockwaveFlash1.Location = temp
temp = Nothing
End If
End If
End Sub
Private Sub AxShockwaveFlash1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles AxShockwaveFlash1.MouseUp
If CustomizeMode = True Then
If e.Button = MouseButtons.Left Then
IsFormBeingDragged = False
regKey.SetValue("POSITION_AxShockwaveFlash1", AxShockwaveFlash1.Location.X & "," & AxShockwaveFlash1.Location.Y)
End If
End If
End Sub
The above code works for any control. But when i am trying to add it for the flash control, if it try to compile the program, i get the following error: "An error occurred creating the form. See Exception.InnerException for details. The error is: Event MouseUp is not valid on this ActiveX control.".
How could i go around this limitation?
Thank you!

New Topic/Question
Reply



MultiQuote




|