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. idea of a very special 'Menuitem'

idea of a very special 'Menuitem'

Scheduled Pinned Locked Moved C#
tutorialquestion
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.
  • N Offline
    N Offline
    nuessler
    wrote on last edited by
    #1

    Hello I've got an idea of a ContextMenu containing special MenuItem's. I've spent the last hours with codeproject, google and a lot of coffee, but I can't find an answer. Perhaps it is very very simple and I'm just too stupid for a clear solution or otherwise it's not possible without writing a complete own implementation of a ContextMenu-class !? ok, here you are : I want to develop a 'customMenuItem'-class that can hold 3 or more icons/buttons (play, stop, continue) and a text entry, everything else should act as usual. I want to set a handler to each of the icons/buttons not to the text. I got no prob's with displaying my Items, but I don't found a way to set this kind of hanld or to decide on which button or Icon I've clicked (tryed with some x-positions-attributes). ok, thanks for reading, but please do not answer with articles like 'how to build menu's with icons', they do not have different handlers for one item or don't analyse any kind of x-position inside. thx's a lot for reading - sorry for my poor english Mark Nüßler

    A D 2 Replies Last reply
    0
    • N nuessler

      Hello I've got an idea of a ContextMenu containing special MenuItem's. I've spent the last hours with codeproject, google and a lot of coffee, but I can't find an answer. Perhaps it is very very simple and I'm just too stupid for a clear solution or otherwise it's not possible without writing a complete own implementation of a ContextMenu-class !? ok, here you are : I want to develop a 'customMenuItem'-class that can hold 3 or more icons/buttons (play, stop, continue) and a text entry, everything else should act as usual. I want to set a handler to each of the icons/buttons not to the text. I got no prob's with displaying my Items, but I don't found a way to set this kind of hanld or to decide on which button or Icon I've clicked (tryed with some x-positions-attributes). ok, thanks for reading, but please do not answer with articles like 'how to build menu's with icons', they do not have different handlers for one item or don't analyse any kind of x-position inside. thx's a lot for reading - sorry for my poor english Mark Nüßler

      A Offline
      A Offline
      alexey N
      wrote on last edited by
      #2

      Play, pause, continue.... You can dynamicaly uptate one item, because when one of them enabled - other items disabled, why do you want to display them all ?

      N 1 Reply Last reply
      0
      • A alexey N

        Play, pause, continue.... You can dynamicaly uptate one item, because when one of them enabled - other items disabled, why do you want to display them all ?

        N Offline
        N Offline
        nuessler
        wrote on last edited by
        #3

        mh, you are right - my example with 'play, pause, continue' is not the best. just imagine some more states or actions, that do not exclude each other. thanks for reading my question and your fast answer

        A 1 Reply Last reply
        0
        • N nuessler

          mh, you are right - my example with 'play, pause, continue' is not the best. just imagine some more states or actions, that do not exclude each other. thanks for reading my question and your fast answer

          A Offline
          A Offline
          alexey N
          wrote on last edited by
          #4

          nuessler wrote:

          just imagine some more states or actions, that do not exclude each other.

          I think that MenuItem designed for single action. Try using standart controls such as toolbar. Or design "floating toolbar".

          1 Reply Last reply
          0
          • N nuessler

            Hello I've got an idea of a ContextMenu containing special MenuItem's. I've spent the last hours with codeproject, google and a lot of coffee, but I can't find an answer. Perhaps it is very very simple and I'm just too stupid for a clear solution or otherwise it's not possible without writing a complete own implementation of a ContextMenu-class !? ok, here you are : I want to develop a 'customMenuItem'-class that can hold 3 or more icons/buttons (play, stop, continue) and a text entry, everything else should act as usual. I want to set a handler to each of the icons/buttons not to the text. I got no prob's with displaying my Items, but I don't found a way to set this kind of hanld or to decide on which button or Icon I've clicked (tryed with some x-positions-attributes). ok, thanks for reading, but please do not answer with articles like 'how to build menu's with icons', they do not have different handlers for one item or don't analyse any kind of x-position inside. thx's a lot for reading - sorry for my poor english Mark Nüßler

            D Offline
            D Offline
            deanofharvard
            wrote on last edited by
            #5

            Hehe... Sounds like a very interesting problem... I've done some stuff that's kinda similar, but means overriding the OnPaint method... You could always dynamically position your control according to the MouseClick event... On_MouseClick(object sender, MouseEventArgs e){ if(e.MouseButton == MouseKeys.Right){ HoverControl control = new HoverControl(); control.Location = new Point(e.Point); control.Show(); } } (Just typed that by hand... It's close, but capitalization and names might be off...) Handle the closing of the control in the control. If you're working with a grid, you could use the object you've got in the selected row of the grid, and if no item selected, don't show the control. Hope this helps... F~

            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