Sunday, 28 April 2013

What are the properties should be given to set method? | VB.Net Interview Questions

Class Class1
' Define a local variable to store the property value.
Example: 
Private PropertyValue As String
' Define the property.
Public Property Prop1() As String
Get
' The Get property procedure is called when the value
' of a property is retrieved.
Return PropertyValue
End Get
Set(ByVal Value As String)
' The Set property procedure is called when the value
' of a property is modified.
' The value to be assigned is passed in the
' argument to Set.
PropertyValue = Value
End Set
End Property
End Class

No comments: