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. Is is possible to change the setting of the ContextMenu?

Is is possible to change the setting of the ContextMenu?

Scheduled Pinned Locked Moved C#
question
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.
  • K Offline
    K Offline
    Khoramdin
    wrote on last edited by
    #1

    Hello everyone, I have a ContextMenu in my Windows Application and I am trying to change it's property but I am unable to do so. For some reason when I change the size of the "Seperator" it goes back to what it was before!!! Can someone tell me what is going on here and how I can change the size of seperators in my ContextMenu. Thank you very much and have a great day Khoramdin

    L M 2 Replies Last reply
    0
    • K Khoramdin

      Hello everyone, I have a ContextMenu in my Windows Application and I am trying to change it's property but I am unable to do so. For some reason when I change the size of the "Seperator" it goes back to what it was before!!! Can someone tell me what is going on here and how I can change the size of seperators in my ContextMenu. Thank you very much and have a great day Khoramdin

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, you should be able to draw a menu item yourself, by setting OwnerDraw true, and providing MeasureItem and DrawItem event handlers. :)

      Luc Pattyn [My Articles]

      K 1 Reply Last reply
      0
      • K Khoramdin

        Hello everyone, I have a ContextMenu in my Windows Application and I am trying to change it's property but I am unable to do so. For some reason when I change the size of the "Seperator" it goes back to what it was before!!! Can someone tell me what is going on here and how I can change the size of seperators in my ContextMenu. Thank you very much and have a great day Khoramdin

        M Offline
        M Offline
        maryamf
        wrote on last edited by
        #3

        hi for change the size property u must first set autosize property to false.

        K 1 Reply Last reply
        0
        • M maryamf

          hi for change the size property u must first set autosize property to false.

          K Offline
          K Offline
          Khoramdin
          wrote on last edited by
          #4

          Hello Maryamf, Thanx for the reply. That is what I thought initially and believe me when I tell you that I tried it. for some reason the Hight works fine but Width setting is not working. It is fix to what it was picked initially by the Contoller. All I wish to do is to reduce the width of the "Seperator" and align in to the left. Just the way the ContextMenu in Visual Studio is! Thank you for your help, mate. Khoramdin -- modified at 13:23 Sunday 15th April, 2007

          1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, you should be able to draw a menu item yourself, by setting OwnerDraw true, and providing MeasureItem and DrawItem event handlers. :)

            Luc Pattyn [My Articles]

            K Offline
            K Offline
            Khoramdin
            wrote on last edited by
            #5

            Hello Luc, Thanx for the help. If I am not mistaken base on your suggestion I can customize the entire ContextMenu. That is something which I might consider if there is no other way to get what I am looking for. The problem is what I am looking for is very simple. I wish to reduce the width of the seperator in the ContextMenu as it overlaps the image that I have placed on the left hand side of the ContextMenu. Thanx for your help, mate. Khoramdin

            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