For anyone that comes looking for help with the exercises using Visual Studio 8:
In the example code shown in the book, pay attention to what specific objects are named when adding them to your window forms.
For example, the exercise for Ch. 2 has you adding labels, buttons and textboxes. Table 2-2 on pages 48-49 as well as the sample code you are to type on showing names like txtName.Text and txtZip.Text, txtDisplayOutput.Text.
To make this example work I had to change the names to textBox1.Text, textBox2.Text etc etc. Also you have to be sure and set the "Output" textbox = to the "buffer"
Here is what it looked like for me instead of what appears on page 49.
Code:
String buffer;
buffer = "Mailing Label:" + Environment.NewLine +
Environment.NewLine;
buffer = buffer + " Name: " + textBox1.Text +
Environment.NewLine;
buffer = buffer + " Address: " + textBox2.Text +
Environment.NewLine;
buffer = buffer + " City: " + textBox3.Text
+ " State: " + textBox4.Text + " ZIP: " + textBox5.Text;
textBox6.Text = buffer;
This is because although you change the "Text" field in the properties pane it does not change the actual "(Name)" as far as the code is concerned. I was unable to actually change the "(Name)" field despite trying several ways. I've never programmed before so if this is incorrect then please straighten my path.
......
|\/\/|