Bargholz Thomas
Posts: 242
Joined: 2006-12-18
|
Hi,
I've been testing some code to create a dynamic menu in a ribbon listing recent documents, to mimic the standard Outlook Attach menu showing the latest 12 documents.
I have the menu set to dynamic load and large items, and add the items dynamically during witch I set caption, description and icon accordingly.
However, in the resulting menu there is an extra blank line between each item (or each item have an automatic line feed in description). This means that my drop down menu is considerably larger than the default Outlook one.
Here is a sample image, with the standard Outlook menu on the left, and what comes from my code on the right:
Here is the code for creating a menu item:
subbutton11 = new ADXRibbonButton();
subbutton11.Size = ADXRibbonXControlSize.Large;
subbutton11.Caption = "Title of the document";
subbutton11.Description = "Additional information about the document";
subbutton11.Id = "LATESTDOC_123456";
subbutton11.Image = 1;
subbutton11.ImageTransparentColor = System.Drawing.Color.Transparent;
subbutton11.OnClick += new ADXRibbonOnAction_EventHandler(buttonAttachLatest_OnClick);
e.AddControl(subbutton11);
I'm using AIE version 8.7.4430.2005.
Can you please direct me into find a solution so that my menu more closely resemble the standard Outlook one, with no additional spacing between items?
Regards
Thomas |
|
Andrei Smolin
Add-in Express team
Posts: 18825
Joined: 2006-05-11
|
Hello Thomas,
I've reproduced the issue. To have the buttons displayed in this way, you set the menu's ItemSize property to Large. The height of the row containing the button becomes larger if you specify ADXRibbonButton.Description. If ADXRibbonButton.Description is specified, there's no way to bypass this issue; you can't control how the Office Ribbon draws a Ribbon button.
Andrei Smolin
Add-in Express Team Leader |
|
Bargholz Thomas
Posts: 242
Joined: 2006-12-18
|
Hi Andrei,
I'm just puzzled why there is such difference between a standard Outlook menu and a custom menu, when specifying the description section. The standard Attach menu does not display this behavior, and it should be the same underlying mechanism that draws the menus.
So it's not AIE that accidentally add's a line feed when the property is set, by any chance?
Otherwise I have to skip using the description property, as the size is correct without it (but it looks so much nicer with this additional info).
Regards
Thomas |
|
Andrei Smolin
Add-in Express team
Posts: 18825
Joined: 2006-05-11
|
Thomas,
They use things unavailable for Office developers; compare the Ribbon gallery created by you and the gallery Styles that Word shows. Add-in Express cannot produce such an effect because the only way to control the Office Ribbon is to provide a ribbon XML. This is exactly what Add-in Express does: it generates the Ribbon XML and gives it to Office on request.
Andrei Smolin
Add-in Express Team Leader |
|