' Visual Basic 2008 9.0 .NET Examples - Implementation - Object Oriented Programming : Namespace Example1 Class Product Private m_Price As Decimal Public Property Price() As Decimal Get Price = m_Price End Get Set(ByVal value As Decimal) m_Price = value setPriceIncludingTax() End Set End Property Private m_TaxPercentage As Decimal Public Property TaxPercentage() As Decimal Get TaxPercentage = m_TaxPercentage End Get Set(ByVal value As Decimal) m_TaxPercentage = value setPriceIncludingTax() End Set End Property Private m_PriceIncludingTax As Decimal Public Function GetPriceIncludingTax() As Decimal GetPriceIncludingTax = m_PriceIncludingTax End Function Private Sub setPriceIncludingTax() m_PriceIncludingTax = Price * (1 + (TaxPercentage / 100)) End Sub End Class Module Client Sub Main() Dim product1 As Product = New Product product1.Price = 100 product1.TaxPercentage = 8 Console.WriteLine(product1.GetPriceIncludingTax()) ' Console.ReadLine() End Sub End Module End Namespace ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.