ToolStripItem.ImageIndex Propriété
Définition
Obtient ou définit la valeur d'index de l'image qui s'affiche sur l'élément.Gets or sets the index value of the image that is displayed on the item.
public:
property int ImageIndex { int get(); void set(int value); };
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.NoneExcludedImageIndexConverter))]
[System.Windows.Forms.RelatedImageList("Owner.ImageList")]
public int ImageIndex { get; set; }
member this.ImageIndex : int with get, set
Public Property ImageIndex As Integer
Valeur de propriété
Index de base zéro de l'image dans ImageList affiché pour l'élément.The zero-based index of the image in the ImageList that is displayed for the item. La valeur par défaut est -1, ce qui signifie que la liste d'images est vide.The default is -1, signifying that the image list is empty.
- Attributs
Exceptions
La valeur spécifiée est inférieure à -1.The value specified is less than -1.
Remarques
La ImageIndex propriété spécifie la position de l’image dans la liste d’images.The ImageIndex property specifies the position of the image in the image list. La ImageKey propriété spécifie l’image elle-même.The ImageKey property specifies the image itself.
Les Imagepropriétés ImageAlign ,ImageKey,, etImageScaling se rapportent à différents aspects de la gestion d’images. ImageIndexThe Image, ImageAlign, ImageIndex, ImageKey, and ImageScaling properties pertain to various aspects of image handling. Utilisez des images ToolStrip dans les contrôles en définissant ces propriétés directement ou en définissant la propriété ImageList d’exécution uniquement.Use images in ToolStrip controls by setting these properties directly or by setting the run-time-only ImageList property.
La mise à l’échelle des images est déterminée par l’interaction ToolStrip des ToolStripItempropriétés dans et, comme suit:Image scaling is determined by the interaction of properties in both ToolStrip and ToolStripItem, as follows:
ImageScalingSizeest l’échelle de l’image finale, telle que déterminée par la combinaison du ImageScaling paramètre de l’image et du paramètre du AutoSize conteneur.ImageScalingSize is the scale of the final image as determined by the combination of the image's ImageScaling setting and the container's AutoSize setting.
Si AutoSize ToolStripItemImageScaling est
true
(valeur par défaut) et SizeToFita la valeur, aucune mise à l’échelle ToolStrip de l’image n’est effectuée et la taille est celle de l’élément le plus grand, ou une taille minimale prescrite.If AutoSize istrue
(the default) and ToolStripItemImageScaling is SizeToFit, no image scaling occurs, and the ToolStrip size is that of the largest item, or a prescribed minimum size.Si AutoSize est
false
et estToolStripItemImageScaling ToolStrip , ni l’image ni la mise à l’échelle ne se produisent. NoneIf AutoSize isfalse
and ToolStripItemImageScaling is None, neither image nor ToolStrip scaling occurs.