Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2006

Tip: Looking for answers? Try searching our database.

A question on VB Classes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 19 Sep 2006 11:58 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
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.