Default values by and large are not allowed in VB.NET unless it is a
parameterized property, like with a collection:
collection.item(x) could be written as: collection(x)
In classic VB you could have default properties (such as .text with a
textbox) because of the difference between objects and data types
x = txtUser was clearly accessing the default .text property of the textbox
and
Set x = txtUser was clearly making x an object reference to the textbox
itself
In .NET, since everything is an object, the Set statement is irrelevant and
no longer supported. However, this created a problem:
Does x = txtUser mean that you want x to take on the .text property value
of the txtUser textbox or does it mean that you want x to become an object
reference to the textbox itself?
To clear up this ambiguity, MS did away with all default properties unless
that are properties that take parameters.
x = collection(x) clearly implies that you are talking about the .item
property of collection because there is a parameter present (x).
x = collection clearly implies that you want x to be an object reference to
the collection object.
Hope this helps.
Scott
"XNoDE" <xn***@sbcglobal.net> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
Hi all,
VS.Net 2002.
Is there a way to set default properties for controls in the Toolbox?
There a some properties that I implement as standard in my apps and would
like to get around setting these same basic things each time a use a
control.
TIA,
XNoDE