ToolBarButton.ImageKey 属性

定义

获取或设置分配给此按钮的图像的名称。Gets or sets the name of the image assigned to the button.

public:
 property System::String ^ ImageKey { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))]
public string ImageKey { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ImageKeyConverter))>]
member this.ImageKey : string with get, set
Public Property ImageKey As String

属性值

String

分配给此工具栏按钮的 Image 的名称。The name of the Image assigned to the toolbar button.

属性

注解

ImageKey值指示 ImageList 分配给父控件的中的图像 ToolBarThe ImageKey value indicates an image in the ImageList assigned to the parent ToolBar control.

ImageKeyImageIndex 是互斥的,也就是说,如果设置了一个,则将另一个设置为无效值并将其忽略。ImageKey and ImageIndex are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. 如果设置了 ImageKey 属性,则 ImageIndex 属性会自动设置为-1。If you set the ImageKey property, the ImageIndex property is automatically set to -1. 或者,如果设置了 ImageIndex 属性,则会 ImageKey 自动将设置为空字符串 ( "" ) 。Alternatively, if you set the ImageIndex property, the ImageKey is automatically set to an empty string ("").

适用于

另请参阅