October 2010
Intermediate to advanced
1920 pages
73h 55m
English
The simple HelloWorld component in Listing 17.1 contains a single method named SayMessage(), which returns a string value. When writing components with Visual Basic .NET, you create methods by creating either a subroutine or a function. Use a subroutine when a method does not return a value, and use a function when a method does return a value.
The SayMessage() method in Listing 17.1 is an instance method. In other words, you must create a new instance of the HelloWorld class before you can call the SayMessage() method like this:
HelloWorld objHelloWorld = new HelloWorld();lblMessage.Text = objHelloWorld.SayMessage();
In the first line, a new instance of the HelloWorld component is created. The SayMessage() method is called ...