Solved

Could someone clarify 'why' this worked out the way it did...

Posted on 2006-07-11
7
161 Views
Last Modified: 2006-11-18
I completed a hands-on project from a textbook I'm reading.

The purpose was to create a composite user control (containing identifying labels and text boxes) referencing a "Person" structure.

Now, it 'worked' okay, but only after I made one minor change to my container form:

The book's solution calls for the form's OK button procedure to be:

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        'Retrieve the entered information
        Dim perPerson As Person

        perPerson = NameEntry.PersonText
        MessageBox.Show( _
        perPerson.id & ControlChars.NewLine & _
        perPerson.Name & ControlChars.NewLine & _
        perPerson.address & ControlChars.NewLine & _
        perPerson.city & ", " & perPerson.state & _
        " " & perPerson.zip, "Display Entered Information")
    End Sub

Where mine ended up 'having' to be:

   Dim perPerson as Person.Person

How come?
0
Comment
Question by:sirbounty
  • 4
  • 3
7 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 250 total points
ID: 17082863
The first Person is the namespace, which would suggest that the Person class is in a different namespace to the Form.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17082971
So, I didn't do what I was instructed to do?  Hmmm - let me check again...
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17083183
Rootspace for "Person" is
Ch12HandsOn
for frmDataEntry is
Ch12HandsOn

This obtained by right-clicking each project and choosing properties...
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 67

Author Comment

by:sirbounty
ID: 17083272
I recreated from scratch and still have the same symptoms...
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17083535
Is there any additional namespace defined for the Person class other than the root namespace ?
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17083536
i.e.

Anything like:

    Namespace Person
        Public Class Person
        End Class
    End Namespace

?
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17083570
I searched the entire projects for "names" (namespace) and it came up empty.
I don't know.  This was supposed to be a 'learn how to do it before you actually do' example.
I'm just a bit discouraged that the meat of the text never dealt with this issue and then right there at the last example, it was dropped in there.  <sigh>
I've given up on it and moved on to my actual assignment.  Thanx anyway - points are yours for the attempt.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now