Sample Popup Panel or DialogBoxLauncher Code

Add-in Express™ Support Service
That's what is more important than anything else

Sample Popup Panel or DialogBoxLauncher Code
Javier Limones

Posts: 3
Joined: 2019-01-10

Is there a sample on how to add a Popup panel to the ribbon in outlook? Something like when you click "Format As Table" in Excel....

Posted 11 Jan, 2019 10:17:07 Top
Andrei Smolin

Add-in Express team

Posts: 15493
Joined: 2006-05-11
Hello Javier,

No such way is provided by the Office Ribbon API. You can create/expand a pane or open a modal form when a dialog launcher is invoked.

AConsider using a gallery with custom drawn items: intercept the PropertyChanging event of the gallery and when Office asks you whether the gallery will be visible or not, populate it with items.

Below is a sketch showing how you create a single item; note that creating an image can be implemented in your code (e.g. using the Windows API) or you can use existing images:

ADXRibbonItem adxRibbonItem = new AddinExpress.MSO.ADXRibbonItem(this.module.Components);
adxRibbonItem.SuperTip = {...};
adxRibbonItem.ScreenTip = {...};
adxRibbonItem.Glyph = {create image};
adxRibbonItem.ImageTransparentColor = System.Drawing.Color.Transparent;
adxRibbonItem.Id = {an id string identifying the item};

Here's how you create the gallery itself:

ribbonGallery = new ADXRibbonGallery(SmartTemplatesAddin.AddinModule.CurrentInstance.Components);
ribbonGallery.Id = {an id string identifying the gallery};
ribbonGallery.Tag = {...};
ribbonGallery.Enabled = {...};
ribbonGallery.Caption = {...};
ribbonGallery.ShowItemCaption = false;
ribbonGallery.Columns = {...};
ribbonGallery.ImageTransparentColor = System.Drawing.Color.Transparent;
ribbonGallery.ItemHeight = {get the height of a gallery item};
ribbonGallery.ItemWidth = {get the width of a gallery item};
ribbonGallery.Ribbons = this.module.Ribbons;
ribbonGallery.Rows = {...};
ribbonGallery.Visible = true;
ribbonGallery.Size = ADXRibbonXControlSize.Large;

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 14 Jan, 2019 07:27:19 Top