|
|
Title | Use the DefaultProperty attribute in VB .NET |
Description | This example shows how to use the DefaultProperty attribute in VB .NET. |
Keywords | DefaultProperty, DefaultPropertyAttribute, attribute, VB.NET, property |
Categories | VB.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
|
|
|
|
|
|