这是我用vb.net写的...
Public Class Cpan
Private _Color As System.Drawing.Color '颜色
Private _Height As Long '高度
Private _Widh As Long '宽度
Private _Name As String '名称
Private _Style As String '型号
Public Sub New(ByVal _Color As System.Drawing.Color, ByVal _Height As Long, ByVal _Widh As Long, ByVal _Name As String, ByVal Style As String)
_Color = Drawing.Color.DarkBlue
_Height = 30
_Widh = 3
_Name = "中华笔厂"
_Style = "BT100"
End Sub
Property Color() As System.Drawing.Color '颜色属性
Get
Return _Color
End Get
Set(ByVal value As System.Drawing.Color)
_Color = value
End Set
End Property
Property Heigth() As Long '高度属性
Get
Return _Height
End Get
Set(ByVal value As Long)
_Height = value
End Set
End Property
Property Widh() As Long '宽度属性
Get
Return _Widh
End Get
Set(ByVal value As Long)
_Widh = value
End Set
End Property
Property Name() As String '名字属性
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
Property Style() As String '型号属性
Get
Return _Style
End Get
Set(ByVal value As String)
_Style = value
End Set
End Property
Public Sub Write(ByVal Str As String) '写的方法
Debug.Print(Str)
End Sub
End Class