Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change mouse right click function

Status
Not open for further replies.

dendic

Programmer
Jan 19, 2003
106
US
I'm using code to move labels around on a form with the left click and mouse move events. When I change the code to recognize a right click instead of the left all works fine but I get dialog boxes for copying, pasting, deleteing etc. Is there a way to disable the dialog boxes with code so I can use the right click and left click just as clicking events.
 
Hallo,

I think there was a Property called Shortcut Menu, or something. Not sure if it was on the form or control, probably form.

Have a play with that...

- Frink
 
have you tried application.displayalerts = false

ck1999
 
How are ya dendic . . .

[blue]Frink[/blue] is on target with reference to shortcut menu's, and there all over the place! However they can all be disabled from appearing.

In a module in the modules, copy/paste the following routine:
Code:
[blue]Public Function EnableShortcuts(Show As Boolean)
   Dim CBar As Object
      
   For Each CBar In CommandBars
      If InStr(1, CBar.Name, "Form View") Then CBar.Enabled = Show
   Next

End Function[/blue]
Next, in the [blue]On Open[/blue] event of the form, copy/paste the following line:
Code:
[blue]   Call EnableShortcuts(False)[/blue]
Finally in the [blue]On Close[/blue] event of the form:
Code:
[blue]   Call EnableShortcuts(True)[/blue]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top