Office 2007 Style Ribbon Control
First off I must give all kudos to menendezpoo at menendezpoo.com for creating an awesome control. This is one of the best written controls I have run across in along time. I found this control like many others in my search for a free ribbon control. The control however fell short of my application requirements and so like others I contacted the author multiple times with no reply so it was either I keep looking for a different one or fix this one. After digging into the code I realized that the control was extremely well written and made excellent use of inheritance so making changes was a snap.
For all documentation on this control please see the authors site. I am documenting the changes I have made since acquiring the original source code. I have upgraded this control to Visual Studio 2008. I therefore have changed the project name to system.windows.forms.Ribbon35 to reflect the usage of the Framework 3.5. This will also avoid any conflicts with the original authors control.
Known Issues…
There are quite a few design time problems with this control once I upgraded it to VS2008. I have not taken the time to fix them so as of this writing most changes made with the designer are not immediately seen. You must save the form and reopen it in order to see your changes. I may someday dig into this and fix it but my time is limited at this point so I am focusing all my time at making sure the control is bug free at run time and contains all the requirements of my current project.
- This control has major problems when inheriting RibbonForm and I haven’t had enough time to really dig into it. I am hoping someone else will step up and take on this part of the control. If you get it fixed please send it to me and I will post it asap. In the meantime check out my workaround below
- Various designer flaws when adding new controls to the ribbon (VS 2008). You must close the form and re-open it to see the new items.
RibbonForm inheritance workaround
Due to the RibbonForm inheritance problems in our ribbon I have been working with a set of free controls from Qios to achieve the same results. You can see their stuff here… http://www.qiosdevsuite.com. They have a free ribbon that looks really neat and has some pretty cool abilites but I found this control so difficult to get working that I scrapped it and stuck with This one. They also have a control called qRibbonCaption. It can provide the Orb and QuickAccessToolbar to the form. If you use this and also inherit from Qios.DevSuite.Components.Ribbon.QRibbonForm you will get the Office style appearance everyone wants. I am now using this control in combination with our ribbon to get a nice looking application. Since the qRibbonCaption control provides the Orb and QAT you don’t need them in our Ribbon. This is why I created the CaptionBarVisible property. Its a little bit of work to get the Orb menu and QAT setup but its worth it. In this release I have included a demo form of how I combined their caption control and our ribbon to achive the desired results. This caption can be added to all your forms in your app to get a clean consistant look. I am now using this control in my application and I have no issues at all.
Next Up…
For those of you interested in knowing what I am doing next here is what I have on my plate. Email me if you have a reqest that is not listed.
- Create an Office 2010 style ribbon orb. This will replace the orb with the start menu style button next to the tabs and remove the caption area. I will most likely create and OrbStyle property Add Office Style Tooltips. There is a post on the CodePlex site from a user who added simple tooltips if you wish to incorporate his. I have left it out since I plan on adding my own.
- I also want to be able to Minimize the ribbon. If your familiar with Office 2007+ then you have probably noticed you can minimize the ribbon so it only shows the tabs and the toolbars are all hidded to allow more room for other things. This is a nifty feature and so I want to do the same thing. This will be a major task so I don’t expect it to be an one evening fix.
- I also want to add a property to force a ribbon button to maintain a certain size. I have run into a couple cases where I wanted to set a minimum width for a button so the text doesn’t wrap on certain words. This only applies when in large mode. I am thinking of calling this new property MinimumSize but only use it when in large mode.
Download Source (ver 3.5.2)Download Source (ver 3.5.2)
Version 3.5.2 (4/17/2010)
I would like to extend a special thanks to Steve Towner for all his help with this release.
This latest release has a few things that lots of you have been wanting. It was not easy to do some of these so your patience has been appreciated. The main enhancement is the addition of a RibbonHost item. This allow you to put any control in the ribbon. The host control can be placed in a panel or a drowdown. I have created an example form to show how to do this.
Bug fixes…
- Fixed painting issue in QuickAccessToolbar when set to RightToLeft.
- Fixed numerous bugs with the visibility property for items and panels. The panel had painting issues when resized and some of the items were hidden.
- Fixed Maximize/Restore button so it work correctly when in RibbonForm Mode. I have since come up with a workaround for this issue. See comment above.
- Fixed cursor issue in checkbox and combobox controls.
- Fixed QuickAccessToolbar Adorner so it is not visible if the QuickAccessToolbar is hidden.
- Fixed Orb Menu so its dipsplayed correctly when in RTL mode. Still need to fix Adorners and sub menus but thats not a show stopper.
- Fixed RibbonPanel so it doesn’t change the visibility of child items. This caused problems if one of the items was invisible and then the panel is shown.
- Fixed RibbonOrb double-click so you can capture the double-click on the orb. Thanks to Steve Towner for fixing this.
- Fixed bug in ComboBox so now the dropdown button clears the highlighting when the dropdown is closed.
- Fixed ItemClick event so now the combobox will update the text when an item is selected in the dropdown. This event was not getting fired due to the Dropdown window being dismissed in the MouseDown event and not in the Click event.
- Fixed Painting issue with RibbonComboBox so the arrow clears the highlight when the dropdown window is dismissed.
- Fixed RibbonPanel centering logic. The panel would incorrectly calculate the dimentions and therefore items wouldn’t appear centered vertically. Thanks to Rod for finding this.
New Stuff…
- Added CaptionBarVisible property so you can hide the entire caption area including the Orb and QuickAccessToolbar to simulate a simple tab control.
- Added new RibbonLabel item so you can place a simple text object anywhere.
- Added TextAlignment property to the label portion of controls so you can set the text alignment(left,center,right).
- Added new RibbonHost Item. Now you can place any control in the ribbon. Care must be taken on its size thought if it goes directly in a panel.
- Added DrawBackground property to RibbonSeparator so you can hide the lines and use it as a flow control.
- Added new DropDownItemClicked event to the ComboBox so you can tell when one of the items is clicked in the dropdown list. This eliminates the need to catch the click event on each item in the dropdown individually.
- Added SelectedItem property to RibbonComboBox so you can access the last selected item in the dropdown. This was Steve Towners idea and a good one.
Version 3.5.1 (3/11/2010)
As expected, I started receiving a ton of requests for new features and so I decided to take on a few of them and then post everything back on Codeplex. I am starting with the ones that make sense and would be something my project may need in the near future. One of those request was the RightToLeft ability. At first I thought this would be rather simple but after digging into the code I spent almost an entire day getting everything to work properly.
- Added new RadioButton Item. This is achieved with the RibbonCheckBox control. I added a new Style property to specify which control to draw. I also added a new event called CheckBoxCheckChanging. This allows you to cancel the change event if you need to. This was requested by someone.uested by someone.
- Cleaned up the Visible property so now items stay visible when in design mode but will be invisible at run-time. This makes designing easier. Also found a few bugs here and there that caused painting issues.
- Added new RightToLeft ability. This is a native property of the control object but was not implemented in the ribbon control.
- I removed the mousewheel support for the tabs. Not only was this annoying but it had problems when trying to scroll on a modal form that was on top of the tabs.
- Added Validating and Validated events to the TextBox and ComboBox controls so you can handle data validation.
Version 3.5.0
- Added Visible property to Tabs, Panels, and Items.
- Fixed Visible property on quick access toolbar. I removed the QuickAccessVisible property. Now you can use the QuickAccessToolbar.Visible property instead.
- Created a new Checkbox Item. Includes Orientation property so you can put the checkbox on the left or right side
- Created a new Up/Down (spin) control. UpButtonPressed and DownButtonPressed events are fired so you can respond accordingly.
- Added new property called LabelWidth to all controls with a label so you can right justify the labels and align controls vertically.
- Added all the Ribbon Items to the Panel’s collection designer.
- Fixed various designer bugs in some of the controls. You still need to close the form and reopen it to see your changes. This only happens when adding a new control in the designer.
- Added new Button Style called DropDownListItem so Button Items added to the DropDown can mimic a standard dropdown without an image and be left aligned.
- Added new property called DrawIconsBar to Dropdown Item so you can hide the gray bar on the left and simulate an indented list item.
- Added AllowTextEdit property to the textbox and combobox controls so you can prevent users from editing the textbox at run time.
- Ribbon now has adjustable height. It used to be fixed size at 136px. Unfortunately, different fonts would cause the button text to get cropped off so I need to be able to tweak the height so buttons with 2 rows of text would be visible. Just change the height in the Size property. No dragging allowed.
Here is a view of some of the new Items and visual layout changes I have made
RightToLeft property