stu nicholls dot com | menu - Professional dropdown #3

Types of Properties

Readonly properties
Example
Module Module1
Sub Main()
System.Console.WriteLine("Value from module " & Module2.prop1)
End Sub
End Module
Module Module2
Private PropertyValue As Integer = 6
Public ReadOnly Property prop1() As Integer
Get
Return PropertyValue
End Get
End Property
End Module

Writeonly properties
Example
Module Module1
Sub Main()
Module2.prop1 = 2
End Sub
End Module
Module Module2
Private PropertyValue As Integer
Public WriteOnly Property prop1() As Integer
Set(ByVal value As Integer)
PropertyValue = value
End Set
End Property
End Module

Default properties
Footer1