Link to home
Start Free TrialLog in
Avatar of rolee
rolee

asked on

Disable Mouse-right click

I am using VB5.0 with MSSQLServer6.5. In my applicaion I want to disable the right click button of the mouse. I would wait for an early reply.
Avatar of rolee
rolee

ASKER

Edited text of question
ASKER CERTIFIED SOLUTION
Avatar of Renes
Renes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rolee

ASKER

It works fine for single click thru right button. But I doubleclicked by chance and I could see all options listed. Can I disable this bouble click from right button too.

Thanks for the information.
Simply by putting it in the Dblclick event for the object

This is my code:

Private Sub DblClick()
Call Sendmessage(Me.hwnd, WM_RBUTTONDOWN, 0, 0&)    'do not show the standard cut and paste menu
End Sub

Let me know if it works..
Avatar of rolee

ASKER

It works fine for single click thru right button. But I doubleclicked by chance and I could see all options listed. Can I disable this bouble click from right button too.

Thanks for the information.
Simply by putting it ALSO in the Dblclick event for the object

This is my code:

Private Sub DblClick()
Call Sendmessage(Me.hwnd, WM_RBUTTONDOWN, 0, 0&)    'do not show the standard cut and paste menu
End Sub



Let me know if it works..
Avatar of rolee

ASKER

yes it works fine. Thanks for your help. As I have many textfields in the application, I am required to write the above code for each field, which could be time consuming. Is there anyway to disable the rightclick at one point and it remains disable through out the form until it is enabled through code again. I don't want to take too much of your time. If there is a possibility, please let me know otherwise I will do for each field.

Thanks anyway for your immediate answer.

If you have many textfields on a form that basicly do the same thing (I don't know if that is the case, but the mouse menu ignore is the same) than you should try to make an array out those textfields so that you can use the 'index' property in the textfields. Like text(1), Text(2), Text(3), Text(4).......

You than can create one event that can handle all the textfields
text(index)_mousedown or something like that. Put the line of code in there and it should work.

There is an example calculator in vbsamples that also works with the (index) for the buttons. Button_click(index as integer)
It has one event for all buttonclicks so look at that if you don't know what I mean..

Don't know if this helps, but could you grade me please it is only twenty points but.....

Goodluck

Avatar of rolee

ASKER

Thanks. I have got the idea. In future, may be, I will use this concept as it could be quite time consuming and risky to change the application.

Thanks anyway. I have increased the points along with grading.