次の方法で共有


RibbonGroup.DialogLauncherClick Event

Definition

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

public:
 event Microsoft::Office::Tools::Ribbon::RibbonControlEventHandler ^ DialogLauncherClick;
event Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler DialogLauncherClick;
member this.DialogLauncherClick : Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler 
Event DialogLauncherClick As RibbonControlEventHandler 

Event Type

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.

void group1_DialogLauncherClick(object sender, Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs e)
{
    advancedSettingsDialog dlg = new advancedSettingsDialog();
    dlg.ShowDialog();
}
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

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.

Applies to