Results 1 to 3 of 3

Thread: [2.0] Context Menu Strip

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    48

    [2.0] Context Menu Strip

    Hello,

    I have a panel with a few images drawn to it. There are areas with images, and areas without images. Now what I want to do is show a different Context Menu Strip depending on if the user right-clicks on an image, or right-clicks on an area without an image.

    What would be the best way to do this?

    Thanks.

  2. #2
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    Re: [2.0] Context Menu Strip

    Try adding the images to the panel with a picture box. Then you could add context menu 1 to the picture box, and context menu 2 to the panel.

    Jennifer.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] Context Menu Strip

    Handle the MouseClick event, test the e.Button property and the e.Location property. If the right button was clicked then you can call Show on the appropriate ContextMenuStrip for the location of the click. Do NOT set the ContextMenuStrip property of the Panel.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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