RibbonDialogLauncher Class (2007 System)
Represents a small standardized icon on a group that can be used to open a dialog box.
Namespace: Microsoft.Office.Tools.Ribbon
Assembly: Microsoft.Office.Tools.Common.v9.0 (in Microsoft.Office.Tools.Common.v9.0.dll)
Syntax
'Declaration
Public NotInheritable Class RibbonDialogLauncher _
Implements IDisposable
'Usage
Dim instance As RibbonDialogLauncher
public sealed class RibbonDialogLauncher : IDisposable
public ref class RibbonDialogLauncher sealed : IDisposable
public final class RibbonDialogLauncher implements IDisposable
Remarks
A RibbonDialogLauncher is displayed in the lower-right corner of a group by default.
The Image, ImageName, and OfficeImageId properties have no visible effect when the RibbonDialogLauncher is displayed in a group on the Ribbon. However, when a user adds a RibbonDialogLauncher to the Quick Access Toolbar, these properties control the behavior of the image that is shown. Also, the Visible property does not hide the RibbonDialogLauncher when it is displayed on the Quick Access Toolbar. The user can add the RibbonDialogLauncher to the Quick Access Toolbar through the Ribbon (XML) item. For more information, see Ribbon Overview.
The RibbonDialogLauncher applies only to a RibbonGroup. The RibbonGroup class has a DialogLauncher member of the RibbonDialogLauncher type. For information about how to add a RibbonDialogLauncher to a RibbonGroup, see How to: Add a Dialog Box Launcher to a Ribbon Group.
Some properties of this control can be set only before the Ribbon is loaded into the Office application. For information about setting these properties, see Ribbon Object Model Overview.
Examples
The following example shows how to add a RibbonDialogLauncher to a Ribbon group and how to launch a custom dialog that enables users to choose advanced settings when they click on the RibbonDialogLauncher icon in the lower right corner of the RibbonGroup.
To run this code example, you must first perform the following steps:
Add a Ribbon (Visual Designer) item to a Visual Studio Tools for Office project.
Add a RibbonDialogLauncher to the default group Group1 as outlined in How to: Add a Dialog Box Launcher to a Ribbon Group.
If you are using Visual Basic, add a new Dialog item to the project. If you are using C#, add a new Windows Form item and turn it into a dialog by adding OK and Cancel buttons to the form and by creating event handlers for the buttons' click events.
Set the (Name) property of the dialog to advancedSettingsDialog. You can customize the dialog by adding controls and setting more properties.
Add the DialogLauncherClick event handler to your code.
Place the contents of the following method into the DialogLauncherClick event handler.
Private Sub Group1_DialogLauncherClick(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Group1.DialogLauncherClick
Dim dlg As advancedSettingsDialog = New advancedSettingsDialog()
dlg.ShowDialog()
End Sub
void group1_DialogLauncherClick(object sender, Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs e)
{
advancedSettingsDialog dlg = new advancedSettingsDialog();
dlg.ShowDialog();
}
Inheritance Hierarchy
System.Object
Microsoft.Office.Tools.Ribbon.RibbonDialogLauncher
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.Office.Tools.Ribbon Namespace
Other Resources
How to: Create Event Handlers in Visual Studio Tools for Office