Can some one please tell me what I'm doing wrong. I'm trying to create
a class called Dog, but Visual Basic tells me that I can't enter
Wolf.age....why is this?
Public Class Form1
Public Class DOG
Dim COLOUR As String
Dim AGE As Integer
Dim NAME As String
End Class
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim WOLF As New DOG
WOLF.AGE = 10
End Sub
End Class
Regards Brian
pvdg42 - 19 Sep 2006 13:39 GMT
> Can some one please tell me what I'm doing wrong. I'm trying to create
> a class called Dog, but Visual Basic tells me that I can't enter
[quoted text clipped - 17 lines]
>
> Regards Brian
Exactly what is the text of the error message you get?
I suspect (without trying to compile your code) that the problem is the way
the member variables are declared in class DOG. Try something like
Public AGE As Integer
instead.
For more, look up "Class Statement (Visual Basic)" in your MSDN Help.