Hello everybody!!! Well I have a class created by myself named MyClass and inside the class I have created the following structure. The what I would like to do, is to access the properties of m_NumDice through the entire class and through the form source code. How can I achieve that? Is there a way or should I have to make it via creating simple properties into the external class and forgetting absolutely the structure m_NumDice???
I tried onto the form load event to access it as MyClass.m_NumDice. what??? no fields appearing...
Any suggestions please??? Any help will be much appreciated. Thank you very much in advanced.
Public Class MyClass
Public Structure m_NumDice
Public NumRd1 As Integer
Public NumRd2 As Integer
Public NumSumRd As Integer
Public Sub New(ByVal val1 As Integer, ByVal val2 As Integer, ByVal sumval As Integer)
NumRd1 = val1
NumRd2 = val2
NumSumRd = sumval
End Sub
Public Property NumDice() As m_NumDice
Get
Return New m_NumDice(NumRd1, NumRd2, NumSumRd)
End Get
Set(ByVal value As m_NumDice)
NumRd1 = value.NumRd1
NumRd2 = value.NumRd2
NumSumRd = value.NumSumRd
End Set
End Property
End Structure
End Class
I tried onto the form load event to access it as MyClass.m_NumDice. what??? no fields appearing...
Any suggestions please??? Any help will be much appreciated. Thank you very much in advanced.
Public Class MyClass
Public Structure m_NumDice
Public NumRd1 As Integer
Public NumRd2 As Integer
Public NumSumRd As Integer
Public Sub New(ByVal val1 As Integer, ByVal val2 As Integer, ByVal sumval As Integer)
NumRd1 = val1
NumRd2 = val2
NumSumRd = sumval
End Sub
Public Property NumDice() As m_NumDice
Get
Return New m_NumDice(NumRd1, NumRd2, NumSumRd)
End Get
Set(ByVal value As m_NumDice)
NumRd1 = value.NumRd1
NumRd2 = value.NumRd2
NumSumRd = value.NumSumRd
End Set
End Property
End Structure
End Class