Javier Limones
Posts: 3
Joined: 2019-01-10
|
Hi...
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....
Thanks! |
|
Andrei Smolin
Add-in Express team
Posts: 18829
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};
gallery.Items.Add(adxRibbonItem);
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;
Andrei Smolin
Add-in Express Team Leader |
|