Microsoft WPF Ribbon - Group buttons as drop down buttons - wpf

I have implemented the Microsoft WPF Ribbon in a WPF browser .NET application.
It is a pretty simply layout with tabs, groups and buttons in the groups. There are however a LOT of groups and buttons and users are having a tough time using the Ribbon on smaller displays. Some of the groups convert the buttons to small image buttons with no text which the users don't like. They have to hover over each button to see it's purpose.
Other groups collapse completely and change to drop down buttons. This they want as standard. Each group to be represented as a drop down button by default and when clicking on it a list of the items as menu items.
To get an idea of what I am after, you can simply reduce the window size until the groups collapse to this drop down effect with menu items.
Can someone help?
The buttons are bound to the ribbon dynamically as are the tabs and groups.

Is there a reason the RibbonMenuButton doesn't suffice?
<r:RibbonMenuButton
Label="Clicking"
SmallImageSource=".."
LargeImageSource="..">
<r:RibbonMenuItem
Header="Click Me 1"
ImageSource=".."/>
<r:RibbonMenuItem
Header="Click Me 2"
ImageSource=".."/>
<r:RibbonMenuItem
Header="Click Me 3"
ImageSource=".."/>
<r:RibbonMenuItem
Header="Click Me 4"
ImageSource=".."/>
</r:RibbonMenuButton>

I think your problem might not be technical, but rather conceptual.
If you take a look at Microsoft's guidelines on ribbons, you'll notice that ribbons are not necessarily the best choice if you have too many commands:
Is there a large number of commands? Would using a ribbon require more than seven core tabs? Would users constantly have to change tabs to perform common tasks? If so, using toolbars (which don't require changing tabs) and palette windows (which may require changing tabs, but there can be several open at a time) might be a more efficient choice.
Maybe you should consider splitting your command groups on several tabs, grouping them logically so that actions that take place together often remain together, while actions that seldom take place together are on separate tabs. For example, changing page size and margins would remain together, while changing font size would go on a separate tab.
You can also consider using contextual tabs that will only appear under certain conditions, and therefore will only show commands related to what the user is doing at the moment.

You can control which buttons are displayed in a RibbonBar when they have been resized (internally by the bar). You can use the RibbonGroup.GroupSizeDefinitions and RibbonTab.GroupSizeReductionOrder properties to define how each RibbonGroup should be displayed. See this Ribbon Layout and Resizing page on MSDN for more information.

Related

Create a screen like control panel windows forms 2010

I am building an application and I would like the one of the forms to look like the control panel
Would you use a listview with groups?
thanks
No, I don't think you can make the ListView do this. At least not without rewriting its painting routines.
It isn't going to be easy to replicate this layout precisely in WinForms. There's nothing you can just drag over from the toolbox that is going to do it. It is possible, but it will take some effort.
What I would do, conceptually, is break it up into pieces. I count 8 different repeated "blocks". So I'd create a UserControl that models each of these.
Inside of the UserControl, I'd have a PictureBox control to display the icon, a Label control to display the heading, and a TableLayoutPanel that can be filled with the desired number of LinkLabel controls. Set all of the properties of the controls so that they match, and then write public methods to set the icon, heading, and add/remove links.
Then I'd drop a TableLayoutPanel onto my form, set the margins to have lots of whitespace, and add as many of those UserControls as necessary. At the top of the form, of course, you'd need another Label to display the heading/instruction text. Make the form's background white, and you're pretty much there.
The logic to switch between views isn't implemented, but consider whether you really need that. It is important in Windows because users are used to the old way of doing things. This doesn't apply to you.

Where is the Tab Order Assignment dialog in Visual Studio 2012?

For as long as I can recall, Visual Studio has had an integrate dialog that allows you to easily organize the tab order of your controls.
I've just created my first VS 2012 WinForms project, added all of my controls and went to find the Tab Indexing dialog, and it appears to be missing from Visual Studio.
I found this MSDN article which states that I can open this dialog by going to FORMAT>Tab order. The problem is that there is no Tab Order option on my FORMAT menu. Alternatively, the documentation states th at Ctrl+D should open this dialog. It doesn't.
Another alternative is to select the VIEW>Tab Order menu option. This method causes Tab Index boxes to hover over your controls. You can subsequently click on your controls, one at a time, in the order in which you want them to tab, to set the tab order.
This isn't acceptable because my form contains numerous panels and group boxes that cover one another. It is impossible for me to click-through my controls because many of them are no longer visible in the designer.
Is there an easy way for me to setup the tab order of my controls like there previously use to be within older versions of Visual Studio?
It is still available, you just need to add it back to the View menu. Tools + Customize, Commands tab, Menu bar = View. Select the menu item in Controls where you want to insert it, say the bottom one. Then Add Command, Category = View, Commands = Tab Order.
Your memory of this command does sound a bit hazy, it was never on the Format menu and its never been a dialog. If you want to put it on the Format menu then you can, just pick the Format menu bar in the Commands tab. You can't make it a dialog though, it numbers the controls in the designer view. Some odds that you actually remembered the View + Document Outline command.
Go to your alignment toolbar. At the end, click the tiny little "Add or Remove Buttons" down arrow. Click the "Add or Remove Buttons" button, and look towards the bottom of the list. You should see Tab Order. Click on that and it will be added to the alignment toolbar.
I found this to be very useful http://msdn.microsoft.com/en-us/library/csz6b8x8.aspx
It allows you to simply click on the various controls in the order that you want them to tab through. You do this while you are in the "Show tab order" mode as described above; the tip from Elton about adding the icon to a toolbar makes it easy to toggle the mode.
Ctrl-doubleclick the first control, then click subsequent controls, and press Enter to terminate. You can also start on the Nth control if you Ctrl-click the one before it, then click in order as normal.
(VS Express 2013)
The Tab order tool from the view menu disappears in some cases. For example, if you clikc a text box, then go to its properties, the tab order option will not show. You must select a control, then immediately go to the view menu and choose tab order.
You can click through your controls with the Document Outline view. If they all have the same TabIndex value, their Z-order will be used as tab order. The Z-order can be changed also with the Document Outline view.

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".

Microsoft Ribbon for WPF: Controling Item Count in QuickAccess Toolbar?

I am getting up to speed on the new Microsoft Ribbon for WPF. I am creating a Ribbon with a Quick Access Toolbar. I have six items in the QAT--I'd like to show four of them and put the other two in the overflow button. At this point, all six buttons are showing, with no overflow button. How do I set the number of visible QuickAccess buttons? Thanks for your help.
As per current development is concerned, I think IsOverflowItem is Readonly. So you dont have the ability to specify for the item to be Overflown or not. It depends totally on how much space you have for the buttons. If you resize the window a bit smaller, you might eventually see the buttons being automatically populated in the menu as the menu will be dynamically created.
So based on the current implementation, you can only specify
<ribbon:RibbonQuickAccessToolBar IsOverflowOpen="True">
to make sure that the QuickAccessToolbar overflows when there is no room for the button.
I wrote an article on Ribbon Control which might help you a bit. Take a look
http://www.abhisheksur.com/2010/08/introducing-ribbon-ui-control-for-wpf.html
Thanks.

Can I make WPF grid controls opaque at design time?

So I'm just starting out with WPF, and I'm really annoyed by the fact that if I lay two Grids on top of one another, the top Grid isn't opaque. It makes designing extremely annoying. Can this be turned off somehow?
I'm just building your standard Winforms STYLE application, but in WPF. I'm just trying to start bridging the gap here. In Winforms(and VB) you'd always have group boxes or something on your form, and then depending on some user context, one of those group boxes would be on top. Its how I've designed forms since time immemorial. One of two things must be true here:
A) This is not the recommended way to design Windows going forward with WPF, but I don't understand what you're supposed to do
B) There is some property to make the Grids opaque so I can build the Window in the style that I'm used to.
I'm fine with answers that solve either A or B. If I'm not doing things the right way because they've changed, then please enlighten me.
Update: So it turns out, I can make the grid opque by setting the background color, but now it seems like I'm locked into a White background as opposed to sticking with the system colors.
You could use SystemColors to make the control background colour match (rather than being white).
I don't understand why you want to put one grid on top of another though. In WPF you generally use a single grid to stack multiple visual elements within one region. Can you explain why you want to hide things in the background with foreground elements?
It sounds a little like you're implementing a tab control -- switching between pages of controls depending on focus. Have you experimented with the new TabControl?
I'm moving from WinForms to WPF development wherever possible and have found that in doing so it's taken some readjustment. WPF has a completely different way of laying things out and now that I'm more comfortable with it, I think it's superior. I'm guessing you just need to ride the learning curve a little longer.
Hope that helps.
EDIT: In response to your comment, I imagine you can have a tab control without tabs, though I haven't tried it myself (might be worthy of another question on SO). Tab controls are headered controls, meaning that they have a header item and a content item. In this case, the header is the tab button, the content is the page item. You can specify a ControlTemplate that details how these items should be displayed relative to one another.
Interestingly, many other types of common GUI element are also headered controls:
Menu items - The menu item text/icon is the header, and the optional submenu is the content
Tree view - Each node is the header, and optional children are within the content
Group box - The header is, well, the header and the content is, well, the content :)
Note that in the case of menu items and tree views, the type may recursively nest within itself. This is quite elegant and can give some wildly different presentation options over the same logical model with only changes to the control template.
For more information read about HeaderedContentControl and HeaderedItemsControl
You could use the following:
<Grid Background="{DynamicResource {x:Static SystemColors.WindowBrush}}">
<!-- content -->
</Grid>
This will respond to changes in the system colors on the fly (the DynamicResource does this).

Resources