Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default value for property
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Default value for property
Divers
Thread ID:
01050633
Message ID:
01050633
Vues:
53
I have the following property in my usercontrol:
[Category("Appearance")]
[Description("The color of the liquid that is inside the thermometer.")]
[DefaultValue(typeof(Color),"Red")]
[RefreshProperties(RefreshProperties.Repaint)]
public Color LiqidColor
{
  get
  {
    return this.liquidColor;
  }
  set
  {
    this.liquidColor = value;
  }
}
Now I have two issues with this.
1. If I right-click in the property sheet and select reset the color returns to Red which is great but when I rebuild the color is all of a sudden gone. What is up with that? I have gotten around this by setting the value of the private member (liquidColor) in this example to equal the default color in the constructor of the class.

2. What is supposed to happend when I change the color in the designer's property sheet? Shouldn't the color change? (I use this color in the OnPaint event. What exactly does RefreshProperties(RefreshProperties.Repaint) do for me?

Thanks,
Einar
Semper ubi sub ubi.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform