SandRibbon User Guide

Introduction

Back to Table of Contents

Goals

SandRibbon is a powerful library designed to allow you to create an interface similar to that of Microsoft Office 2007 in a practical, easy to use way. It sits on the Windows Forms framework, allowing excellent levels of designer support and great graphical responsiveness.

Virtually every UI feature pioneered with Office 2007 is available for you to use in the SandRibbon library.

Controls and Widgets

At the heart of SandRibbon is the windowless control library we built to support all the features offered by this type of UI. The plumbing for this is contained in SandRibbonControlBase, which is an abstract class that coordinates a tree of windowless controls and looks after animations etc. You will never use this directly but it helps to know that the ribbon controls you will use, such as Ribbon, RibbonTab and StatusBar inherit from it.

Each control in the library has a tree of windowless "widgets" or "items". These are exposed in a meaningful way depending on the control in use. Each RibbonTab control, for example, exposes its top-level chunks through its Chunks collection. The StatusBar control exposes two properties, MainStrip and ExtendedStrip, which represent the strips of items available.

Almost every item you will deal with in SandRibbon is a "widget", which is the name we have given to the windowless controls that make up a SandRibbon user interface. You normally do not have to concern yourself with the top-level controls that host them, only the widgets themselves.

Managers and the RibbonForm

In a coordinated user interface it is useful to have a central object that looks after the various components that make up that user interface. This functionality is provided in SandRibbon by the RibbonManager class. Normally, you will simply add an instance of this class to your form at design time and it will create a Ribbon and a StatusBar for you, and associate itself with them. However, you can create either of these controls in a standalone fashion and add a manager later if you like.

It is important to have a manager, because they look after coordinated rendering, keyboard accelerators, keyboard quick-access and keyboard focusing of the various ribbon elements. If all your ribbon controls are associated with the same manager, you can change rendering settings there and everything will update itself automatically.

RibbonForm is a class that inherits from Form and applies special drawing and layout logic to enable the custom-shaped forms seen in Office 2007. By inheriting from RibbonForm instead of Form, your application will take on a distinctive look and feel, and this will unlock the full functionality of the Ribbon itself. The custom forms allow advanced features like drawing in the titlebar, so features like the application button, quick access toolbar and contextual tab hints are only available when the ribbon is placed on a RibbonForm.

Next: Getting Started