Figure 41-1 contains a copy of Figure 38-7 instead of the correct figure. Click this thumbnail to see the correct image at full scale.
Due to changes during writing, some of the controls and variables were renamed after the programs' first versions. Unfortunately some of the new names did not get into the text so the text and the downloadable code may differ.
In this case, control names such as lblRed were changed in the code to redLabel but the text was not properly updated.
If you see control names such as this that don't match the code, simply change them. More generally, if you build a program and name a control redLabel, be sure to use that name when you write your code.
As always, if you have trouble getting the code to work, please let me know and I'll help get you back on the right track.
The third paragraph says:
...open the Tools menu and select Import and Export Settings...
This command may not be directly in the Tools menu for all versions of Visual Studio. If it isn't there, you may need to look in the Tools menu's Settings submenu.
The second paragraph of the "What's in a name, Part 3" box says:
If you name this control numUfoDetectorsValue, they you won't need...
This should be:
If you name this control numUfoDetectorsValue, then you won't need...
Nestor Feliciano found that my solution for Exercise 5-5 was incorrect. He said:
Selecting Format > Bullet from the MenuStrip updates the GUI to display both the MenuItem and ContextMenuItem as selected or deselected. However, selecting Bullet from the ContextMenuStrip does not work correctly.
Both of these menu items have CheckOnClick = true so they toggle their state. The Bullet menu item also updated the context menu item. Unfortunately I then hooked both menu items up to the Bullet menu item's event handler so the context menu item wasn't updating the menu item.
To fix this, I decided to set CheckOnClick = false and use the following code for both menu items.
private void formatBulletMenuItem_Click(object sender, EventArgs e)
formatBulletMenuItem.Checked = !formatBulletMenuItem.Checked;
bulletContextMenuItem.Checked = formatBulletMenuItem.Checked;
I updated the download code on 2/8/2011 so if you downloaded the code after that you'll see the new version.
In Figure 11-2, the bottom check box has the wrong caption. It should read:
!((A && B) || (!A && !B))
James Jamieson noticed that the name of the horizontal scroll bar in the code at the bottom pf page 53 was referred to as both hbarRed and hscrRed. On the top of the next page, the green and blue scroll bars are named hscrGreen and hscrBlue.
Unfortunately late in the book development process the names of those controls got changed and it seems that they got updated in some places but not in others. In fact, they really should have been changed to redHScrollBar to be more consistent with common C# naming conventions. The actual name doesn't really matter to the program but it is important that the names are consistent. In other words, the red scroll bar must have the same name everywhere it is used.
Sorry about the confusion.
Barrie Adsett noticed some confusion in the declaration of the array on page 198. To handle values up to 4 times 7 (as it says in the book) it should be dimensioned:
int[,] values = new int[5, 8];
Figure 16-3 shows enough room to go to 3 times 7. Perhaps I should have stuck with that because the picture would back it up nicely.