Partilhar via


RibbonGroup.DialogLauncherClick Event

Occurs when the user clicks the Ribbon dialog launcher icon in the group.

Namespace:  Microsoft.Office.Tools.Ribbon
Assembly:  Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)

Syntax

'Declaration
Event DialogLauncherClick As RibbonControlEventHandler
event RibbonControlEventHandler DialogLauncherClick

Remarks

The Ribbon dialog launcher is a small icon that appears in the group. When the user clicks this icon, you can handle the DialogLauncherClick event to open a custom dialog box. By default, groups do not have a Ribbon dialog launcher. For more information, see How to: Add a Dialog Box Launcher to a Ribbon Group.

Examples

The following example shows how to add a dialog box launcher 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:

  1. Add a Ribbon (Visual Designer) item to an Office project.

  2. Add a RibbonDialogLauncher to the default group as outlined in How to: Add a Dialog Box Launcher to a Ribbon Group.

  3. If you are using Visual Basic, add a new Windows Form Dialog item to the project. If you are using C#, add a new Windows Form item and turn it into a dialog by adding an OK and Cancel button to the form and creating event handlers for the buttons' click events.

  4. Set the (Name) property of the dialog to advancedSettingsDialog. You can customize the dialog by adding controls and setting more properties.

  5. Add the DialogLauncherClick event handler to your code.

  6. 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();
}

.NET Framework Security

See Also

Reference

RibbonGroup Interface

Microsoft.Office.Tools.Ribbon Namespace

Other Resources

How to: Add a Dialog Box Launcher to a Ribbon Group