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 Location [Solved]

Context Menu Location [Solved]

Scheduled Pinned Locked Moved C#
helptutorialquestion
3 Posts 2 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.
  • I Offline
    I Offline
    ignrod
    wrote on last edited by
    #1

    Hi all, Using the Show() method of ContextMenu class ( in Windows.Forms ) it is possible to show a Context Menu. One of the arguments to the Show() method is the top left position of the Context Menu. What I know is, instead of the top left position, the bottom left position of the Context Menu. I would like to translate this somehow to the top left position, however, neither ContextMenu nor MenuItem seem to have a Height or Size property. Does anyone know how to fix the bottom left position of a Context Menu? Any help would be greatly appreciated. Thank you.

    modified on Saturday, August 14, 2010 11:23 AM

    S 1 Reply Last reply
    0
    • I ignrod

      Hi all, Using the Show() method of ContextMenu class ( in Windows.Forms ) it is possible to show a Context Menu. One of the arguments to the Show() method is the top left position of the Context Menu. What I know is, instead of the top left position, the bottom left position of the Context Menu. I would like to translate this somehow to the top left position, however, neither ContextMenu nor MenuItem seem to have a Height or Size property. Does anyone know how to fix the bottom left position of a Context Menu? Any help would be greatly appreciated. Thank you.

      modified on Saturday, August 14, 2010 11:23 AM

      S Offline
      S Offline
      SimulationofSai
      wrote on last edited by
      #2

      You could use ContextMenuStrip to create your shortcut menus. That's interchangeable with ContextMenu and has several additional properties and methods including Height and Width.

      SG Aham Brahmasmi!

      I 1 Reply Last reply
      0
      • S SimulationofSai

        You could use ContextMenuStrip to create your shortcut menus. That's interchangeable with ContextMenu and has several additional properties and methods including Height and Width.

        SG Aham Brahmasmi!

        I Offline
        I Offline
        ignrod
        wrote on last edited by
        #3

        Thank you for your reply. The ContextMenuStrip has a Size property and can be used to place the Context Menu above the point I want to use. Interestingly, the Size of the ContextMenuStrip is wrong the first time Show is called, so finally I used the method ContextMenuStrip.Show(PointToScreen(p, ToolStripDropDownDirection.AboveRight).

        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