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.
Related
Silverlight 4 has a new ContextMenu control in the latest toolkit.
I can't find any examples anywhere on how to reliably use this ContextMenu on a DataGrid row. Theres a tonne of context menus out there but I want to use the new version from the toolkit.
I'd like to be able to set context menus for rows as well as cells.
The only way I've found is to manually create the menu on right click and show it, but I'd like to do it in XAML.
Note: You need to currently use this workaround to avoid binding problems when using ContextMenu in XAML for a datagrid cell.
The developer of the Toolkit's ContextMenu wrote this article, specifically talking about using it with a DataGrid Delay's Blog
You can use this open source multi-level menu and context menu as alternative:
www.sl4popupmenu.codeplex.com
The demo on the main page shows how to do it in code. But you can also create the menu anywhere in your XAML like any other control and then associate it with the Datagrid using the RightClickElements property. The control will then handle everything else for you.
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.
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.
I want to create a combobox with some style. I dont want old dropdown what we are getting. I want some new dropdown which looks very nice. Is there any way to create a dropdown like that.
Plz give me suggestions
Check this link out on msdn. This is the actual control template for the combo box. You can copy and paste this into your application (within your app's Resources).
Create a form and slap a combo box on it with some data in it. Then start changing the control template and view the results. Start off simply by changing colors and adding borders around elements to see what controls which part. Then you can start switching out larger parts of the template to match what you're looking for.
one can start with the standard combobox, and then use various controls and styles to change the look and feel of the control, and it's corresponding drop down.
does anyone know about a windows forms control that acts like the address bar of a browser?
it is just like a textbox, but to the right there is a dropdown menu that shows the history of previously entered text.
thanks a lot!
Look at properties "AutoCompleteCustomSource", "AutoCompleteMode" and "AutoCompletesource" on TextBox class.
You can use a ComboBox for this. Just add the previous entries to the item list. If what you actually want is AutoComplete, the WinForms TextBox control supports that natively.