Re: defaultValueAttribute

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mike G. (theNOSPAMjunkbox_at_comcast.net)
Date: 10/22/04


Date: Fri, 22 Oct 2004 10:08:44 -0400

Thanks Jorge,

I created a new web control library project to test this. I had one
property that did not specify the defaultvalue attribute, but gave the
property a default value by assigning a value to the private variable. That
value correctly displayed in the IDE. I then added the defaultvalue
attribute and assigned it a different value. There was no change in the
IDE. Am I missing something?

Mike

"Jorge Matos" <JorgeMatos@discussions.microsoft.com> wrote in message
news:983110A0-3B6E-45A8-8F83-CD06268C5CAE@microsoft.com...
> Its an attribute that the VS.NET IDE looks at when displaying your custom
> property in the properties window. If the attribute is found, the
> designer
> will display your property with the value specified by the attribute.
>
> "Mike G." wrote:
>
>> I have a dumb question: What does the defaultvalue attribute do?
>>
>> The help system says that it "Specifies the default value for a
>> property",
>> and provides the following as an example:
>>
>> Private MyVar as Boolean = False
>> <DefaultValue(False)> _
>> Public Property MyProperty() As Boolean
>> Get
>> Return MyVar
>> End Get
>> Set
>> MyVar = Value
>> End Set
>> End Property
>>
>> It seems to me that MyProperty has a default value of false because of
>> the
>> first line:
>> Private MyVar as Boolean = False
>>
>> So, what exactly does DevaultValue(False) do?
>>
>> Thanks!
>>
>> Mike
>>
>>
>>



Relevant Pages

  • Re: Static link problems using VS2005
    ... If you dont specify a build order, ... IDE mode will look at the librarythe project depends upon and build ... So if you forget to specify the build order and dont use ... linked into the app project which depends on the DLL project). ...
    (microsoft.public.vc.mfc)
  • Re: IDE better than NETbeans for gui component positioning ?
    ... And with good reason! ... You *can't* specify the exact position of the components ... That's why *Java* discourages it (the IDE has nothing to do with it) and uses ...
    (comp.lang.java.programmer)
  • Re: IDE better than NETbeans for gui component positioning ?
    ... And with good reason! ... You *can't* specify the exact position of the components ... That's why *Java* discourages it (the IDE has nothing to do with it) and uses ...
    (comp.lang.java.softwaretools)
  • Re: IDE better than NETbeans for gui component positioning ?
    ... And with good reason! ... You *can't* specify the exact position of the components ... That's why *Java* discourages it (the IDE has nothing to do with it) and uses ...
    (comp.lang.java.gui)
  • Re: Newbie - Redirect to do processing
    ... overwhelmed with very long pages and like to separate processing from ... displaying for maintainability). ... attribute to specify the location to process the form. ... action entry of the FORM element for that (see W3C.org site about the ...
    (comp.lang.php)