Results 1 to 11 of 11

Thread: [RESOLVED] how can i get Left click event of Mouse?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Resolved [RESOLVED] how can i get Left click event of Mouse?

    HI All!
    In my application i have to have all the three events of a mouse.... like left click, right click and the middle button(scroll) click events.

    I already wrote the event mouses's down event. in that event i am able to get the middle button(scroll)'s event and right click event, but i am unable to get the left button's click event....

    How can i get this Leftclik event of mouse? here is my sample code...

    Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Button = 4 Then
    boolDragDrop = True
    End If

    If Button = 2 Then
    Delete.Tag = Index
    Me.PopupMenu RClick
    End If

    If Button = 1 Then 'this is not working..... how can i get this ?
    MsgBox ("\nyes...it is button1")
    End If

    End Sub

    Please let me know... if u know this..

    Thanks in advance:
    regards:
    raghunadhs.v

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how can i get Left click event of Mouse?

    Code:
    Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
       MsgBox "Left click"
    ElseIf Button = vbRightButton Then
       MsgBox "Right Click"
    End If
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Re: how can i get Left click event of Mouse?

    oh! Hack.....
    i wrote accordingly.. as u said.. Still it is not working, the right click event is working but left click is not working... what is the reason?

    Another thing, i already wrote two events "form_dragover" and "form_dragdrop".. is thre any constraint that if we use those form's events, the left clik event shold not work... or there is any thing else..

    Thanks in advance:
    regards:
    raghunadhs

    Quote Originally Posted by Hack
    Code:
    Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
       MsgBox "Left click"
    ElseIf Button = vbRightButton Then
       MsgBox "Right Click"
    End If
    End Sub

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how can i get Left click event of Mouse?

    Quote Originally Posted by raghunadhs
    oh! Hack.....
    i wrote accordingly.. as u said.. Still it is not working, the right click event is working but left click is not working... what is the reason?
    I have no idea. It worked just fine for me.

    What kind of a mouse do you have?

  5. #5
    Addicted Member xavierjohn22's Avatar
    Join Date
    Oct 2006
    Location
    Approx. 4921' and 3.11" asl
    Posts
    249

    Re: how can i get Left click event of Mouse?

    I am not sure but maybe you have leave begindrag ongoing, somewhere in code.

    Set action To vbCancel, vbBeginDrag, Or vbEndDrag (values 0, 1, And 2 respectively) To cancel an ongoing drag-And-drop operation, To initiate a drag-And-drop operation, Or To End a drag-And-drop operation (i.e., drop the control).

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how can i get Left click event of Mouse?

    Quote Originally Posted by xavierjohn22
    I am not sure but maybe you have leave begindrag ongoing, somewhere in code.

    Set action To vbCancel, vbBeginDrag, Or vbEndDrag (values 0, 1, And 2 respectively) To cancel an ongoing drag-And-drop operation, To initiate a drag-And-drop operation, Or To End a drag-And-drop operation (i.e., drop the control).
    This has nothing to do with the thread topic. Are you sure you posted in the right thread?

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Re: how can i get Left click event of Mouse?

    Hi Hack!
    my mouse is DELL branded.. ok.. i will see it again... if u get any new idea please let me know that...
    Thanks
    regards:
    raghunadhs

    Quote Originally Posted by Hack
    I have no idea. It worked just fine for me.

    What kind of a mouse do you have?

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how can i get Left click event of Mouse?

    I have used vbLeftButton and vbRightButton for years and have had a problem with them.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Re: how can i get Left click event of Mouse?

    Hack!
    i tried, the same example in another dummy application. Its working. but in my current application it is not working. i think there is some problem in my current application. i think it may be due to either "form_Dragover" or and "form_dragdrop" . i will once look into this.. and make you know the feed back.
    Thanks for your immediate correspondence:
    regards:
    raghunadhs.v

    Quote Originally Posted by Hack
    I have used vbLeftButton and vbRightButton for years and have had a problem with them.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Re: how can i get Left click event of Mouse?

    Hi Hack!
    I got the bug... in my application i am doing some drag drop operations on images. for this purpose i set the "dragmode" property to "automatic". due to this the left click event is not being occured. suppose if again set that property to "manual" again it is working...

    Thanks Hack, your efforts gave me pleasure:
    regards:
    raghunadhs.v

    Quote Originally Posted by Hack
    I have used vbLeftButton and vbRightButton for years and have had a problem with them.

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how can i get Left click event of Mouse?

    No problem. If you consider this resolved, you could help us out by pulling down the Thread Tools menu and clicking the Mark Thread Resolved menu item. That will let everyone know that you have your answer.

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width