Office 2007/2010 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 a long 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 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 projects.

  1. 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
  2. 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 the 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 ribbon and inherit from 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.

 

Office 2010 Style is Finally Here

Download Source (ver 3.5.4)


Version 3.5.4 (11/20/2011)

Now that I had a chance to use the ribbon in another app I ran into a couple other features that I needed. I also fixed a couple bugs that were reported. I decide to post this release right away instead of sitting on the them utill I had more stuff.

New Stuff...

  1. Added SelectedItem and SelectedValue feature to the RibbonButton. This is identical to the RibbonDropDown logic added earlier so you can track DropDownItems as they are clicked.
  2. Added CheckGroup ability to the RibbonButton. Now Buttons will Toggle State when in a panel or a Popup window.
  3. Added bottom border to the Ribbon when Minimized. This closer resembles the Office Ribbon.

Bug fixes...

  1. Fixed bug in RibbonDropDown when a dropdown in nested in another dropdown. The dropdown list was incorrectly positioned on the screen.
  2. Fixed Tooltip border so its darker and also the positioning was a pixel off so I fixed that.

Version 3.5.3 (11/20/2011)I

would like to thank everyone for being patient as I worked through some important projects before being able to tackle this release.  This release posed a greater challenge than I had anticipated. The minimize feature opened up a lot of issues once I dug into it. The Minimize has one major flaw that I have not resolved yet.  The ribbon currently Docks to the top so any other controls that Doc along with the Ribbon are adjusted when the Ribbon is Expanded and Collapsed.  The only way to avoid this is to not dock any other controls with the Ribbon but rather set their location to the bottom of the ribbon when its collapsed.  This will give the effect that the ribbon floats over the other controls while expanded.

This latest release has 3 of the most requested features of all. Office 2010 style Orb, Tooltips, and a Minimize ability.

Office 2010 Orb

  1. OrbStyle - Sets the 2007 or 2010 style Orb./li>
  2. OrbText - Sets the Text tOrbStyle - Sets the 2007 or 2010 style Orb.
  3. OrbText - Sets the Text to appear on the orb when in 2010 style.
  4. OrbImage - Sets the image to use on the Orb Button.

Tooltips

  1. TooltipText - Sets the Text that appears in the Body of the Tooltip window.
  2. TooltipTitle - Sets the Text that appears in the Title of the Tooltip.
  3. TooltipImage - Sets the custom image to use in the tooltip.

Minimize

  1. Minimize - Enables or Disables the minimize feature.
  2. Expanded - Gets or Sets if the Ribbon is currently expanded when the Minimize feature is enabled.
  3. ExpandedChanged() - Event raised when the Ribbon expands and collapses.

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

  1. Fixed painting issue in QuickAccessToolbar when set to RightToLeft.
  2. 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.
  3. 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.
  4. Fixed cursor issue in checkbox and combobox controls.
  5. Fixed QuickAccessToolbar Adorner so it is not visible if the QuickAccessToolbar is hidden.
  6. 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.
  7. 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.
  8. Fixed RibbonOrb double-click so you can capture the double-click on the orb. Thanks to Steve Towner for fixing this.
  9. Fixed bug in ComboBox so now the dropdown button clears the highlighting when the dropdown is closed.
  10. 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.
  11. Fixed Painting issue with RibbonComboBox so the arrow clears the highlight when the dropdown window is dismissed.
  12. 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...

  1. Added CaptionBarVisible property so you can hide the entire caption area including the Orb and QuickAccessToolbar to simulate a simple tab control.
  2. Added new RibbonLabel item so you can place a simple text object anywhere.
  3. Added TextAlignment property to the label portion of controls so you can set the text alignment(left,center,right).
  4. 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.
  5. Added DrawBackground property to RibbonSeparator so you can hide the lines and use it as a flow control.
  6. 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.
  7. 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.

  1. 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.
  2. 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.
  3. Added new RightToLeft ability.  This is a native property of the control object but was not implemented in the ribbon control.
  4. 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.
  5. Added Validating and Validated events to the TextBox and ComboBox controls so you can handle data validation.

Version 3.5.0

  1. Added Visible property to Tabs, Panels, and Items.
  2. Fixed Visible property on quick access toolbar.  I removed the QuickAccessVisible property.  Now you can use the QuickAccessToolbar.Visible property instead.
  3. Created a new Checkbox Item.  Includes Orientation property so you can put the checkbox on the left or right side
  4. Created a new Up/Down (spin) control. UpButtonPressed and DownButtonPressed events are fired so you can respond accordingly.
  5. Added new property called LabelWidth to all controls with a label so you can right justify the labels and align controls vertically.
  6. Added all the Ribbon Items to the Panel's collection designer.
  7. 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.
  8. 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.
  9. Added new property called DrawIconsBar to Dropdown Item so you can hide the gray bar on the left and simulate an indented list item.
  10. Added AllowTextEdit property to the textbox and combobox controls so you can prevent users from editing the textbox at run time.
  11. 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