This is a library used by various articles on this site.
These are the steps to create it.
Practical
Learning: Creating the StoreItem Library
|
|
- To create a new project, on the main menu, click File -> New -> Project...
- In the Project Types list of the Add New Project dialog box, click Visual
Basic Projects
- In the Templates list, click Class Library
- Change the Name to StoreItem
- Click OK
- In Solution Explorer, right-click Class1.vb and click Rename
- Change the name to StoreItem.vb and press Enter
- Change the file as follows:
<Serializable()> Public Class CStoreItem
Private nbr As String
Private nm As String
Private sz As String
Private uprice As Double
Public Sub New()
nbr = ""
nm = ""
sz = ""
uprice = 0.0
End Sub
Public Sub New(ByVal number As String, ByVal name As String, _
ByVal size As String, ByVal price As Double)
nbr = number
nm = name
size = sz
uprice = price
End Sub
Public Property ItemNumber() As String
Get
Return nbr
End Get
Set(ByVal Value As String)
nbr = Value
End Set
End Property
Public Property ItemName() As String
Get
Return nm
End Get
Set(ByVal Value As String)
nm = Value
End Set
End Property
Public Property ItemSize() As String
Get
Return sz
End Get
Set(ByVal Value As String)
sz = Value
End Set
End Property
Public Property UnitPrice() As Double
Get
Return uprice
End Get
Set(ByVal Value As Double)
uprice = Value
End Set
End Property
End Class
|
- To create the library, in the Solution Explorer, right-click the StoreItem
node and click Build
- Close Visual Studio .NET
|
|