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