Icons on MainMenu/ContextMenu without losing theming - winforms

I would like to use MainMenu and ContextMenu in my WinForms app, and put icons next to some of the menu items. But MenuItem doesn't have any way to specify an icon.
It would be easy to add one with owner-draw, but then my menu looks owner-drawn -- I lose all of the default drawing from the XP/Vista theme.
What's the best way to get icons on a MainMenu (or ContextMenu) and still play nice with theming?
I'm not specifically attached to MainMenu; I'm also open to third-party menu replacements (including commercial ones), as long as they're high-quality and support hiding menu items at runtime. I am not open to MenuStrip because it satisfies neither of those criteria (see e.g. this bug that Microsoft refuses to fix).

Related

How do I override the default Windows Phone theme for my app?

Lets say that, regardless of what color settings the user has, I want my app to have a white background with blue foreground elements, like the Skype app does.
How do I go about that? I've found how I can make elements use the system brushes, but I can't figure out how to change those default brushes. I also can't find where the background color is specified at all.
You can use a library created by Jeff called PhoneThemeManager. You can find the article about the same here: PhoneThemeManager. Just download it from NuGet and modify your app.xaml.cs file to get Light (white background) theme activated. The code is simple:
ThemeManager.ToLightTheme();
Once you apply the theme, all your pages will have white background. For blue foreground elements, you'll need to create your own styles and apply them to elements. I'll prefer Blend to create design template over here as you'll get WYSIWYG interface. Using system brushes will not help as those will change according to Accent color. Creating your own styles will give you more freedom and control.
I hope this helps.
Check out how to apply theme resources to wp8 app, it describes exactly what you're looking for.
The most convenient way to accomplish this Task is to use Expression Blend.
Expression Blend is most suitable for this purpose as it will provide and intuitive interface.
The Interface is shown below for a WP app (7.1, it applies to WP8 as well)
The interface is easy to use.
Select an Item on Objects and Timeline
An object is selected and UI updates in middle.
Now Check the right side for properties. See the Background is selected. Select the required color of choice and other properties.
Pros: This applies to various elements including Menu Items, Buttons and all.
Cons: Items such as MessageBox can't be customized this way.

WinForms tab-control replacement that's usable with a large number of tabs

Our app has a tab control that shows a variable number of tabs. Most of the time, there are a handful of tabs, and the "tabbed" metaphor is simple and easy to use.
But on rare occasions (when working with certain types of data), we might need many more tabs than will fit across the screen. When that happens, the trusty tab control is no longer a good user experience. Whether you do multiple rows of tabs, or the little scroll buttons, finding the tab you want becomes a huge headache.
Visual Studio's editor can handle this situation with relative grace. It only shows a limited number of tabs at a time (however many will fit across the screen); and if you want something that's not currently visible, there's a dropdown button that shows the complete list. Are there any third-party WinForms tab controls that offer similar functionality -- a few tabs at a time, plus a dropdown?
There will actually be times when even the dropdown list would be too long to fit on the screen, so it would be helpful to know how any tab controls deal with that. A scrollbar (where you can drag the thumb quickly to the right neighborhood) would be great; so would incremental searching using the keyboard.
For purposes of this question, assume that replacing the tabs with some other UI metaphor (e.g. a listbox down the left side) is not an option. (We are exploring that, but that's not what this question is about.)
Telerik have a commercial Winforms control library which has a control called RadPageView. This can behave similar to what you describe when in StripView mode. The library is costly just for this one control though.
DevExpress also have one as part of their XtraEditors library called XtraTabControl. This has an "Additional paint style emulating the Visual Studio 2005 tabbed interface", although there are no screen shots of what that looks like. There is a screen shot on this page, although it doesn't look like what you require.
Infragistics has a WinTab control that can be customized to do this. If you set ShowTabListButton to True, you get the dropdown button that shows a list of all the tabs; and if you set ScrollButtons to None and ShowPartialTab to False, it will only show as many tabs as will fit.
It's also very performant -- I can add 750 tabs in less than a second (as opposed to 6 seconds for the standard WinForms TabControl, and 43 seconds for the DevExpress XtraTabControl). It even supports content that's shared across all the pages, which happens to be something our app needs.
The only downside is, when you click the "tab list" dropdown, it shows the list in a dropdown menu. This menu doesn't support incremental searching with the keyboard; and if the menu is taller than will fit on the screen, there's no way to scroll quickly -- you just get "scroll up" and "scroll down" buttons, which scroll painfully slowly. So when the list is longer than will fit on the screen, this dropdown menu is just as unusable as scrolling horizontally through a long list of tabs.
On the other hand, there's a SpaceAfterTabs property, which lets you leave blank space to the right of the last tab. It would be possible to put a combo box, or some other sort of dropdown control, in that blank space, and roll your own, better-behaved overflow "menu".

Winform TabControl style

I'm once again turning to you since I can't find an answer anywhere else. I have a TabControl, but I want to get rid of the ugly orange bar on top of the selected tabs. I would also like to make the tab text BOLD when selected and NORMAL when not.
Is there any easy way to achieve that goal ? I don't want to use the Appearance Buttons or Flat Buttons.
Thanks for your help !
This appearance is controlled by the Visual Styles theme selected in your operating system. In general, users do not appreciate any program that ignores their theme settings, especially when they paid money for a custom one. But you can get what you want, you'll have to set the DrawMode property to OwnerDrawFixed and implement a handler for the DrawItem event. There's a good example to get you started in the MSDN Library article for this event. Just change the font assignment in that sample code.

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.

WinForms open popup usercontrol as menuitem menu dropdown?

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.

Resources