Groups | Blog | Home
all groups > dotnet academic > september 2006 >

dotnet academic : A question on VB Classes


pvdg42
9/19/2006 7:39:36 AM

[quoted text, click to view]

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.

Brian
9/19/2006 10:58:20 PM
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

AddThis Social Bookmark Button