sirbounty
asked on
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?
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rootspace for "Person" is
Ch12HandsOn
for frmDataEntry is
Ch12HandsOn
This obtained by right-clicking each project and choosing properties...
Ch12HandsOn
for frmDataEntry is
Ch12HandsOn
This obtained by right-clicking each project and choosing properties...
ASKER
I recreated from scratch and still have the same symptoms...
Is there any additional namespace defined for the Person class other than the root namespace ?
i.e.
Anything like:
Namespace Person
Public Class Person
End Class
End Namespace
?
Anything like:
Namespace Person
Public Class Person
End Class
End Namespace
?
ASKER
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.
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.
ASKER