AuthorMessage
Meka][Meka
Unstopable
Posts: 700

--------------------------
Understanding Properties
--------------------------
Author: Meka][Meka
--------------------------
http://www.meka-meka.com/
--------------------------
A Property is very similar to a standard class, only it uses Properties, we will use the standard code from the first tutorial: http://www.meka-meka.com/forum/viewtopic.php?t=104
then change the code in the class1.vb to:
Code:

Public Class UserProperty
    Private strName As String
    Private intAge As Integer
    Private boolTemp As Boolean
    Property sName() As String
        Get
            Return strName
        End Get
        Set(ByVal Value As String)
            strName = Value
        End Set
    End Property
    Property iAge() As Integer
        Get
            Return intAge
        End Get
        Set(ByVal Value As Integer)
            intAge = Value
        End Set
    End Property
    Property bTemp() As Boolean
        Get
            Return boolTemp
        End Get
        Set(ByVal Value As Boolean)
            boolTemp = Value
        End Set
    End Property

this will now act the same, this is better for if users may be interacting with the classes, and also very much better for if your are creating a user control