mouseup has to follow mousedown?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan

    mouseup has to follow mousedown?

    i have a form with a label on it

    Private Sub Label1_mousedow n(ByVal sender As System.Object, ByVal e As
    System.Windows. Forms.MouseEven tArgs) Handles Label1.MouseDow n
    ' do stuff
    End Sub


    Private Sub Label1_mouseup( ByVal sender As System.Object, ByVal e As
    System.Windows. Forms.MouseEven tArgs) Handles Label1.MouseUp
    ' do stuff
    End Sub

    It seems that the Mouseup event can only be triggered after the mousedown
    event has happened. In other words, I can't mousedown on the form somewhere
    (not on the label), then drag the mouse over my label, and mouseup, the event
    doesn't fire.

    Similarly, if you mousedown on the label, then drag your mouse elsewhere,
    and mouseup, the event does fire. It seems that that should be a form mouseup
    event rather than a label mouseup, since you're not over the label anymore.
    Can anyone explain this? Is there a way to make a mouseup event fire
    regardless of where you mousedowned?
  • Robby

    #2
    Re: mouseup has to follow mousedown?


    It sounds like you are trying to implement drag-drop functionality. If this
    is the case then you need to look at the Clipboard and DataObject classes
    and the DataObject.DoDr agDrop method. More information can be found that
    this link;




    Hope this helps

    Robby

    "Alan" <Alan@discussio ns.microsoft.co m> wrote in message
    news:82D39510-9849-46A8-9235-375018B485A4@mi crosoft.com...[color=blue]
    >i have a form with a label on it
    >
    > Private Sub Label1_mousedow n(ByVal sender As System.Object, ByVal e As
    > System.Windows. Forms.MouseEven tArgs) Handles Label1.MouseDow n
    > ' do stuff
    > End Sub
    >
    >
    > Private Sub Label1_mouseup( ByVal sender As System.Object, ByVal e As
    > System.Windows. Forms.MouseEven tArgs) Handles Label1.MouseUp
    > ' do stuff
    > End Sub
    >
    > It seems that the Mouseup event can only be triggered after the mousedown
    > event has happened. In other words, I can't mousedown on the form
    > somewhere
    > (not on the label), then drag the mouse over my label, and mouseup, the
    > event
    > doesn't fire.
    >
    > Similarly, if you mousedown on the label, then drag your mouse elsewhere,
    > and mouseup, the event does fire. It seems that that should be a form
    > mouseup
    > event rather than a label mouseup, since you're not over the label
    > anymore.
    > Can anyone explain this? Is there a way to make a mouseup event fire
    > regardless of where you mousedowned?[/color]


    Comment

    Working...