我有是令人沮喪的我沒有盡頭的一個問題,我有一個父類覆寫投放功能,並在子類覆蓋功能,如下圖所示:如何使用父類中子類的值? vb.net
子類
Public Overrides Sub UpdatePrice(ByVal dblRetailPrice As Double)
If dblWholesalePrice < 0 Then
MessageBox.Show("Error, amount must be greater than 0.")
Else
dblRetailPrice = dblWholesalePrice * dblStandardMargin
End If
End Sub
,並在父類中,我有
Public ReadOnly Property RetailPrice() As Double
Get
Return dblRetailPrice
End Get
End Property
Public Overridable Sub UpdatePrice(ByVal dblRetailPrice As Double)
If dblWholesalePrice < 0 Then
MessageBox.Show("Please input an amount greater than 0,wholesale price has not changed", "error")
Else
dblRetailPrice = 1.1 * dblWholesalePrice
End If
End Sub
當我調試,產生的價值,但它並沒有延續到父類ski.RetailPrice()的,似乎是什麼問題這裏?任何幫助將不勝感激。
-0.25仍然使用匈牙利命名法:P – cHao 2012-03-31 06:03:19