Results 1 to 5 of 5

Thread: Right Click On Menu Item

  1. #1

    Thread Starter
    Hyperactive Member dogfish227's Avatar
    Join Date
    Oct 2002
    Location
    GA
    Posts
    409

    Right Click On Menu Item

    is there a way to detect when a user right clicks on a menu item?? if so how?

  2. #2
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618
    Look at the MouseDown event, and then check e.Button to see which mouse button was clicked.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  3. #3

    Thread Starter
    Hyperactive Member dogfish227's Avatar
    Join Date
    Oct 2002
    Location
    GA
    Posts
    409
    there is no mouse down event for clicking on a menuItem only a click event and it dosent have an e nor does it event fire when you click it with the right mouse button

  4. #4
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    Uhmmmm....if you can accept this way:
    Press your right button ---> Holding right button pressed, press the left button.
    In this way you can use something like:

    VB Code:
    1. Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
    2.         If Me.MouseButtons = MouseButtons.Right Then
    3.             MessageBox.Show("Right one")
    4.         Else
    5.             MessageBox.Show("Left one")
    6.         End If
    7.     End Sub

    It seems to work.
    Is ti useful for you?
    Good job
    Live long and prosper (Mr. Spock)

  5. #5

    Thread Starter
    Hyperactive Member dogfish227's Avatar
    Join Date
    Oct 2002
    Location
    GA
    Posts
    409
    well ive decided to do it a different way but thanks for your responce

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