Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to add custom property to a form?
Message
De
17/03/2007 11:19:28
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
17/03/2007 07:28:56
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01204821
Message ID:
01204987
Vues:
20
Well, those hypocrites!!!

>Hi Mike:
>
>There are numerous examples of suggested naming conventions for c#, Microsoft is just one of them. If you look at some of MS's dll's using reflector, you will see the use of "_variables" all over the place.
>
>
>
>
>
>
>>I could be wrong, but I thought I read/was told/found out someway recently that Microsoft standards discouraged the use of an underscore in variables. I understand that Microsoft programming conventions might not always be the suggested naming conventions though.
>>
>>>You were given the correct syntax to do this; however, the example does not follow suggested naming conventions used in c#. You may wish to use this style (or set up your own. Underscores are used for private level field variables. I point this out just for educational purposes.)
>>>
>>>
>>>private string _myProperty = "";
>>>public string MyProperty {
>>>	get {
>>>		return _myProperty;
>>>	}
>>>	set {
>>>		_myProperty = value;
>>>	}
>>>}
>>>
>>>
>>>
>>>
>>>>Thank you, Alexandre. I have to rethink your code to C# but you gave me a good start.
>>>>
>>>>>Dimitry you can try
>>>>>on the form
>>>>>Friend MyProperty as String
>>>>>or
>>>>>Private myPropertyValue As String
>>>>>Public Property MyProperty() As String
>>>>> Get
>>>>> Return myPropertyValue
>>>>> End Get
>>>>> Set(ByVal value As String)
>>>>> 'properties are nice when you want to also do some processing
>>>>> 'Me.HasChanged = True as an example
>>>>> myPropertyValue = value
>>>>> End Set
>>>>>End Property
>>>>>
>>>>>>I need to keep track of "something" as the Timer event (.Tick <g>) fires. In VFP world (used to be a language like that, maybe some of you older folk remember <g>) it was done by adding a custom property to a form. Then this property was in scope in any method of the form.
>>>>>>
>>>>>>Is there a way to set such a custom property to a Win.net form? Or, if not, what would be another way to do it?
>>>>>>
>>>>>>Thank you.
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform