' Visual Basic 2008 9.0 .NET Examples - Inheritance - Object Oriented Programming : Class SettableCounter : Inherits Counter Public Sub SetValue(ByVal value As Integer) m_Value = value End Sub End Class Module Client2 Sub Main() Dim counter1 As Counter = New Counter With counter1 Console.WriteLine(.GetValue() = 0) .Raise() Console.WriteLine(.GetValue() = 1) .Lower() Console.WriteLine(.GetValue() = 0) End With ' Dim specialCounter1 As SettableCounter = New SettableCounter With specialCounter1 Console.WriteLine(.GetValue() = 0) .SetValue(10) Console.WriteLine(.GetValue() = 10) .Raise() Console.WriteLine(.GetValue() = 11) .Lower() Console.WriteLine(.GetValue() = 10) End With ' Console.ReadLine() End Sub End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.