Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Context Menu strip

Context Menu strip

Scheduled Pinned Locked Moved C#
helpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hiremath71
    wrote on last edited by
    #1

    hi, i have created the form and placed the contextmenustrip on it, and enterd some values like copy,cut. And i called that when user clicks the MouseRight Button it is displaying. But at always at the Top of the window. How can I place it where ever user clciks. Pls help me With Regards Prasad

    M 1 Reply Last reply
    0
    • H hiremath71

      hi, i have created the form and placed the contextmenustrip on it, and enterd some values like copy,cut. And i called that when user clicks the MouseRight Button it is displaying. But at always at the Top of the window. How can I place it where ever user clciks. Pls help me With Regards Prasad

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Hello, The ContextMenu property is a member of System.Windows.Forms.Control. So if you set the property correct, you don't have to care about the position of the menu.

      System.Windows.Forms.ContextMenu contextMenu1 = new System.Windows.Forms.ContextMenu();
      System.Windows.Forms.MenuItem.MenuItemCollection mic = new System.Windows.Forms.Menu.MenuItemCollection(contextMenu1);
      mic.Add("test1");
      mic.Add("test2");
      button1.ContextMenu = contextMenu1;

      All the best, Martin

      H B 3 Replies Last reply
      0
      • M Martin 0

        Hello, The ContextMenu property is a member of System.Windows.Forms.Control. So if you set the property correct, you don't have to care about the position of the menu.

        System.Windows.Forms.ContextMenu contextMenu1 = new System.Windows.Forms.ContextMenu();
        System.Windows.Forms.MenuItem.MenuItemCollection mic = new System.Windows.Forms.Menu.MenuItemCollection(contextMenu1);
        mic.Add("test1");
        mic.Add("test2");
        button1.ContextMenu = contextMenu1;

        All the best, Martin

        H Offline
        H Offline
        hiremath71
        wrote on last edited by
        #3

        thank you with Regards prasad

        1 Reply Last reply
        0
        • M Martin 0

          Hello, The ContextMenu property is a member of System.Windows.Forms.Control. So if you set the property correct, you don't have to care about the position of the menu.

          System.Windows.Forms.ContextMenu contextMenu1 = new System.Windows.Forms.ContextMenu();
          System.Windows.Forms.MenuItem.MenuItemCollection mic = new System.Windows.Forms.Menu.MenuItemCollection(contextMenu1);
          mic.Add("test1");
          mic.Add("test2");
          button1.ContextMenu = contextMenu1;

          All the best, Martin

          B Offline
          B Offline
          Benhar 2009
          wrote on last edited by
          #4

          :(( could not understand the coding please send me with windows application for clear understand

          1 Reply Last reply
          0
          • M Martin 0

            Hello, The ContextMenu property is a member of System.Windows.Forms.Control. So if you set the property correct, you don't have to care about the position of the menu.

            System.Windows.Forms.ContextMenu contextMenu1 = new System.Windows.Forms.ContextMenu();
            System.Windows.Forms.MenuItem.MenuItemCollection mic = new System.Windows.Forms.Menu.MenuItemCollection(contextMenu1);
            mic.Add("test1");
            mic.Add("test2");
            button1.ContextMenu = contextMenu1;

            All the best, Martin

            B Offline
            B Offline
            Benhar 2009
            wrote on last edited by
            #5

            :(( could not understand the coding please send me with windows application for clear understand benharcharles@gmail.com

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups