Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to 'hide' a property?
Message
 
À
18/09/2005 01:59:50
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01050663
Message ID:
01050845
Vues:
25
Perry,
Wow that sounds like an awfull lot of work for such a 'simple' thing.
Do you have an example you could post?

Thanks,
Einar
>I don't have exactly, but I hope I can point you in the right direction.
>
>1) Insert a line before the line "public class....your custom control. Add a Designer attribute on this line that points to "YourClassName.DesignerClass".
>
>2) Add an internal class within your control class called "DesignerClass". It needs to match the name you gave in the designer attribute in #1. This class needs to inherit from ControlDesigner. This requires you to add a reference to System.Design.
>
>3) In the internal class you can create a override method "PostFilterProperties" with the signature:
>protected void PostFilterProperties(System.Collections.IDictionary properties)
>
>4) In this new method add:
>properties.Remove("Text");
>
>HTH,
>
>PF
>
>>What is the best way to 'hide' a property from the property sheet?
>>I am creatin a custom control which I am inheriting from System.Windows.Forms.Control and as a result of that I get a Text property in the property sheet at design time. My control will not make use of the Text property so why even show it. So what is the best way of removing the Text property.
>>
>>Thanks,
>>Einar
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform