[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

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

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
sirbounty
Asked:
sirbounty
  • 4
  • 3
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
The first Person is the namespace, which would suggest that the Person class is in a different namespace to the Form.
0
 
sirbountyAuthor Commented:
So, I didn't do what I was instructed to do?  Hmmm - let me check again...
0
 
sirbountyAuthor Commented:
Rootspace for "Person" is
Ch12HandsOn
for frmDataEntry is
Ch12HandsOn

This obtained by right-clicking each project and choosing properties...
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
sirbountyAuthor Commented:
I recreated from scratch and still have the same symptoms...
0
 
Carl TawnSystems and Integration DeveloperCommented:
Is there any additional namespace defined for the Person class other than the root namespace ?
0
 
Carl TawnSystems and Integration DeveloperCommented:
i.e.

Anything like:

    Namespace Person
        Public Class Person
        End Class
    End Namespace

?
0
 
sirbountyAuthor Commented:
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

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now