Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleUse the DefaultProperty attribute in VB .NET
DescriptionThis example shows how to use the DefaultProperty attribute in VB .NET.
KeywordsDefaultProperty, DefaultPropertyAttribute, attribute, VB.NET, property
CategoriesVB.NET
 
The DefaultProperty attribute sets a class's default property.

Suppose the Employee component's LastName property is its default property. Suppose you select a form and click on the FormBorderStyle property in the Properties window. Now you click on an Employee. Because Employee doesn't have a FormBorderStyle property, the Properties window displays its default property, LastName.

 
<DefaultProperty("LastName")> _
Public Class Employee
    ...
    Public Property LastName() As String
        ...
    End Property
    ...
End Class
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated