How to Create Class In VB.NET
How to Create Class In VB.NET
Rate How to Create Class In VB.NET
(1(1 Vote))
Module General
Public Sub Main()
Dim aCBook As New CBook()
With aCBook
.BookID = "1234"
.BookTitle = "Programming with VB.NET"
.Author = "Hari Reddy"
.Publisher = "Digital Publishing Solutions"
System.Console.WriteLine(.BookID)
System.Console.WriteLine(.BookTitle)
System.Console.WriteLine(.Author)
System.Console.WriteLine(.Publisher)
System.Console.WriteLine(.Price)
End With
aCBook = Nothing
End Sub
End Module
'Paste the following code in class. here u have create general module class--from the project menu add new class
Option Explicit On
Option Strict On
Public Class CBook
Private m_sBookID As String
Private m_sBookTitle As String
Private m_sPublisher As String
Private m_sAuthor As String
Private m_sngPrice As System.Currency
Public Property BookID() As String
Get
Return m_sBookID
End Get
Set
m_sBookID = Value
End Set
End Property
Public Property BookTitle() As String
Get
Return m_sBookID
End Get
Set
m_sBookTitle = Value
End Set
End Property
Public Property Publisher() As String
Get
Return m_sPublisher
End Get
Set
m_sPublisher = Value
End Set
End Property
Public Property Author() As String
Get
Return m_sAuthor
End Get
Set
m_sAuthor = Value
End Set
End Property
Public Property Price() As System.Currency
Get
Return m_sngPrice
End Get
Set
m_sngPrice = Value
End Set
End Property
End Class
How to Create Class In VB.NET Comments
No comments yet — be the first to post one!
Post a Comment