p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 (http://p2p.wrox.com/forumdisplay.php?f=34)
-   -   Chapter 13 p. 509 (http://p2p.wrox.com/showthread.php?t=16211)

arienlee July 30th, 2004 05:20 PM

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:)

bmains July 31st, 2004 07:19 AM


Could you post this relevant code?


All times are GMT -4. The time now is 01:05 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.