• 您的位置我爱Aspx >> VB.Net >> VB.Net中文教程(6) 母子对象关系
  • VB.Net中文教程(6) 母子对象关系

  • 作者:aspxer  来源:internet  日期:2007-5-20 14:00:18  关键字:.net
  • GetSize = rSize

    End Function

    End Class

    Class Desk

    Protected dSize As Double

    Public Sub New()

    dSize = Room.GetMother().GetSize() * 0.18

    End Sub

    Public Function GetSize() As Double

    GetSize = dSize

    End Function

    End Class

    @#----------------------------------------------------

    Class MyRoom

    Inherits Room

    Private rd As New Desk()

    Public Sub New()

    rSize = 100

    End Sub

    Public Sub Show()

    MessageBox.Show("Room Size: " + str(rSize))

    MessageBox.Show("Desk Size: " + str(rd.GetSize()))

    End Sub

    End Class

    @#----------------------------------------------------

    Public Class Form1

    Inherits System.WinForms.Form

    Public Sub New()

    MyBase.New()

    Form1 = Me

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:VB.Net中文教程(5)程序多重定义
    下一篇:VB.Net中文教程(7) Me参考值