|
-
Jul 27th, 2007, 06:59 AM
#1
Thread Starter
Addicted Member
[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
-
Jul 27th, 2007, 07:13 AM
#2
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
-
Jul 27th, 2007, 08:21 AM
#3
Thread Starter
Addicted Member
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
 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
-
Jul 27th, 2007, 09:10 AM
#4
Re: how can i get Left click event of Mouse?
 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?
-
Jul 27th, 2007, 11:10 AM
#5
Addicted Member
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).
-
Jul 27th, 2007, 11:46 AM
#6
Re: how can i get Left click event of Mouse?
 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?
-
Jul 27th, 2007, 12:11 PM
#7
Thread Starter
Addicted Member
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
 Originally Posted by Hack
I have no idea. It worked just fine for me.
What kind of a mouse do you have?
-
Jul 27th, 2007, 12:12 PM
#8
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.
-
Jul 27th, 2007, 01:11 PM
#9
Thread Starter
Addicted Member
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
 Originally Posted by Hack
I have used vbLeftButton and vbRightButton for years and have had a problem with them.
-
Jul 27th, 2007, 01:23 PM
#10
Thread Starter
Addicted Member
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
 Originally Posted by Hack
I have used vbLeftButton and vbRightButton for years and have had a problem with them.
-
Jul 27th, 2007, 01:25 PM
#11
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|