PropertyValueUIItem Classe
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Fournit des informations sur une propriété affichée dans la Fenêtre Propriétés, y compris le gestionnaire d’événements associé, la chaîne d’informations contextuelles et l’icône à afficher pour la propriété.
public ref class PropertyValueUIItem
public class PropertyValueUIItem
type PropertyValueUIItem = class
Public Class PropertyValueUIItem
- Héritage
-
PropertyValueUIItem
Exemples
L’exemple de code suivant fournit un PropertyValueUIItem objet pour toutes les propriétés du composant nommé HorizontalMargin ou VerticalMargin. Les PropertyValueUIItem propriétés suivantes fournissent une image, une info-bulle et un gestionnaire d’événements qui affiche une boîte de message lorsque l’image de la propriété est cliquée. Cet exemple de code fait partie d’un exemple plus large fourni pour l’interface IPropertyValueUIService .
// PropertyValueUIHandler delegate that provides PropertyValueUIItem
// objects to any properties named HorizontalMargin or VerticalMargin.
private void marginPropertyValueUIHandler(
System.ComponentModel.ITypeDescriptorContext context,
System.ComponentModel.PropertyDescriptor propDesc,
ArrayList itemList)
{
// A PropertyValueUIHandler added to the IPropertyValueUIService
// is queried once for each property of a component and passed
// a PropertyDescriptor that represents the characteristics of
// the property when the Properties window is set to a new
// component. A PropertyValueUIHandler can determine whether
// to add a PropertyValueUIItem for the object to its ValueUIItem
// list depending on the values of the PropertyDescriptor.
if (propDesc.DisplayName.Equals("HorizontalMargin"))
{
Image img = Image.FromFile("SampImag.jpg");
itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
}
if (propDesc.DisplayName.Equals("VerticalMargin"))
{
Image img = Image.FromFile("SampImag.jpg");
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
}
}
Constructeurs
| Nom | Description |
|---|---|
| PropertyValueUIItem(Image, PropertyValueUIItemInvokeHandler, String) |
Initialise une nouvelle instance de la classe PropertyValueUIItem. |
Propriétés
| Nom | Description |
|---|---|
| Image |
Obtient l’image de 8 x 8 pixels qui sera dessinée dans la Fenêtre Propriétés. |
| InvokeHandler |
Obtient le gestionnaire déclenché lorsqu’un utilisateur double-clique sur cet élément. |
| ToolTip |
Obtient ou définit la chaîne d’informations à afficher pour cet élément. |
Méthodes
| Nom | Description |
|---|---|
| Equals(Object) |
Détermine si l’objet spécifié est égal à l’objet actuel. (Hérité de Object) |
| GetHashCode() |
Sert de fonction de hachage par défaut. (Hérité de Object) |
| GetType() |
Obtient la Type de l’instance actuelle. (Hérité de Object) |
| MemberwiseClone() |
Crée une copie superficielle du Objectactuel. (Hérité de Object) |
| Reset() |
Réinitialise l’élément d’interface utilisateur. |
| ToString() |
Retourne une chaîne qui représente l’objet actuel. (Hérité de Object) |