WinForms open popup usercontrol as menuitem menu dropdown? - winforms

Been searching everywhere and can't find a way to do this.
I have a menubar across the top of my winforms program. Now it just pops up a normal menuitem menu. I would like to disable that menu and popup a nice looking usercontrol that looks like its the dropdown for that menu item but includes much more customization. A good example would be the gnome menu bar in OpenSuse or the Start Menu in windows vista.
Can anybody point me to a tutorial or help me out in finding a way to do this?
Right now I know that as long as the menuitem has no subitems a menu won't appear, which is what I want to do, but I would like to simulate that menu with my own usercontrol when that menuitem is clicked.
Thanks!!!

I had to add my own trackbar to the toolbar recently which involves deriving from ToolStripControlHost. I imagine that you will need to do something similar as MenuStrip is a derivation of ToolStrip.
This is an MSDN tutorial for using ToolStripControlHost and here is a CodeProject article about adding a custom control to a ToolStripDropDownButton.

Related

WPF Tab item sliding on mouse hover

I want the tab item to be displayed by sliding effect as given in VS 2010, eg. when we point docked objects like toolbox, solution explorer, properties it is shown immediately. In that way i want my tabcontrol to display items by sliding effect. is it possible? Please Help...
you can achieve similar things by making use of AvalonDock, its opensource.

Can a dock window dock anywhere or just on top, bottom, left, right?

I need use a lot of such windows in my UIs (WPF, WinForms)
say a label with text "Settings", When mouse hovers it, a window will show up and when mouse moves away, the window disappear. The label and the window should line up looks as if they were a tab control with the label being header, the window being tab item.
The label can be in anywhere of main UI.
I am thinking of dock window.
I just start so not sure if my question makes sense.
My understanding is I can use nested dock windows, like use a dock window inside a panel, the panel is one child of parent panel/window. but nested panels are not quite straight/easy. so I wonder if a dock window can dock anywhere? thanks
I think the best solution for you could be to use an existing library and don't reinvent the wheel. Please see THIS excellent docking library, possible it offers all requirements that you need. Its name is AvalonDock and it is used by several big projects. An example is SharpDevelop, this software use the AvalonDock library. Hope this could be helpful to you...

Need a listbox of drop-down commands

In WinForms, I have to quickly set up a list of items that have some text and a dropdown of commands/buttons. This would be easy in XAML (I'm getting spoiled), but I'm not familiar with Winforms.
Do any of the std Winform controls provide this?
Can anyone suggest a 3rd party control??
The image shows a drop-down being shown when hovered.
Thanks
Looks like a normal context menu, so you can probably do this with the ContextMenuStrip component. Call one of its Show() methods when you want to open it.

Word style context menu in WPF?

What controls would be most suitable for creating a complex context menu, similar what you see in Windows Word. Should it be pop up, tooltip, or context menu or a transparent window?
What you think would be the best control to start with?
I'd start with a ContextMenu, since that is the behaviour you want. Unlike a ToolTip that won't automatically disappear after a few seconds, and it is already set up to by a collection of MenuItems.

Get the standard context menu for System.Windows.Forms.RichTextBox

How can I get the standard context menu in a RichTextBox, like the one in TextBox (Copy, Paste, IME etc.)? I'd go with a P/Invoke solution if nothing is available out of the box. Or do I really have to follow those strange advices to create a custom menu to get a standard menu (sigh)?
The ContextMenuStrip property of the richtextbox can be assigned to a user designed context menu, Copy/Cut/Paste and just apply the RichTextBox's methods to each of the menu items such as CanUndo, CanCopy, CanPaste to determine the menu item's Enabled property. Using the methods 'Copy,CutandPaste` will be the executed method for the menu item's click event.
Hope this helps,
Best regards,
Tom.

Resources