View Single Post
  #1 (permalink)  
Old July 30th, 2004, 05:20 PM
arienlee arienlee is offline
Registered User
 
Join Date: Jul 2004
Location: duluth, mn, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 p. 509

In VB.Net Second Edition I was doing the example in chapter 13 and got to page 509 entering the example code as I went.

The thing that I noticed was that I would change the MessageText property that we created in the "Public Sub New()" in the MyControl we created per the shown example, but I got a curious result.

I found that the MessageText would seem to work correctly, but then the Set MessageText would get run again, this time with the data from the property set on the form. In this case, it was not mentioned to set the MessageText property on the form, so it was blank and so this caused a different result than stated in the book. I know for sure this was the case as I followed the code step by step using watches.

It seemed that once the Public Sub New() completed running for the new MyControl the MessageText Set function would then run again, this time with the data from the MessageText property from the form.

This was easy enough to get around by moving a line of code to the form's New subroutine ( MyControl1.MessageText="Hello World").

Anyways, I just wanted to know if I was doing something wrong, was this an error in the book, or due to a newer version of VS.NET?

My version of VS.NET is the Academic version;
 Microsoft Development Environment 2003 7.1.3088
 Microsoft .Net Framework 1.1 1.1.4322

Thanks in advance for any help:)