Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
User Controls
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Divers
Thread ID:
00674153
Message ID:
00674199
Vues:
22
Just modify the Get method of your mask property to return the tinmask as follows:
    Public Property mask() As tmask
        Get
            Return tinmask
        End Get
        Set(ByVal Value As tmask)
            tinmask = Value
        End Set
    End Property
>I'm trying to create a user control using VB .Net. The control is based on the the windows textbox and does some basic masking of input.
>
>I created a property based on an enum value which determines the current mask for the control. When I test the control on a windows form, the property (named mask) does appear in the property list for the control, but the value of the property can not be modified. There is a drop down box which lists the enumerated values, but the selected value can not be changed. The class definition is as follows:
>
>
>Public Class mtb1
> Inherits System.Windows.Forms.TextBox
>
> Public Enum tmask
> None
> Numeric
> Phone
> Capme
> End Enum
>
> Private tinmask As tmask
>
> Public Property mask() As tmask
> Get
>
> End Get
> Set(ByVal Value As tmask)
> tinmask = Value
> End Set
> End Property
>
> ..... (all the masking code)
>End Class
>
>
>Does anyone know how to create a property which allows the developer to see (and select from) a list of options in that are predefined?
>
>
>Any information would be greatly appreciated!
>
>Thanks -
>Rick Napolitan
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform