Megosztás a következőn keresztül:


RibbonDialogLauncher.ImageName Property

Gets or sets an identifier that is used to assign an image to this RibbonDialogLauncher when it is added to the Quick Access Toolbar.

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

Syntax

'Declaration
Property ImageName As String
string ImageName { get; set; }

Property Value

Type: System.String
An identifier that is used to assign an image to this RibbonDialogLauncher when it is added to the Quick Access Toolbar.

Remarks

This property can be set at run time only under certain conditions. For more information, see Ribbon Object Model Overview.

The ImageName property has no visible effect when the RibbonDialogLauncher is displayed in a group on the Ribbon. However, when a user adds a RibbonDialogLauncher to the Quick Access Toolbar, this property controls the behavior of the image that is shown, unless the Image or OfficeImageId property is also set.

The ImageName property identifies an image that is displayed by the control. The Office application retrieves this image from your solution only once, to improve performance. This property can be set only at design time, because the image it identifies is loaded during the LoadImage event. LoadImage is raised only once per image name, when the Ribbon is displayed. After that, the control image cannot be changed by using this property.

To load the image, add code to the LoadImage event handler. Check the ImageName property of the RibbonLoadImageEventArgs and set the Image property of the RibbonLoadImageEventArgs object to the image that you want to load.

This property is ignored if either the Image property or the OfficeImageId property is set. Images identified by the ImageName property can be loaded slightly faster than images identified by the Image property, because the Office application retrieves the image from your solution only the first time the Ribbon is displayed.

.NET Framework Security

See Also

Reference

RibbonDialogLauncher Interface

Microsoft.Office.Tools.Ribbon Namespace

Other Resources

Ribbon Object Model Overview