Using Visual Basic.NET Features to Code a Windows Forms Application
(Page 1 of 4 )
Welcome to the fourth part of a five-part series that shows you how to code and test a Windows Forms application. In this part you'll learn how to use the smart compile auto correction feature, the My feature, and more. This article is excerpted from chapter three of
Murach's Visual Basic 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774456).
How to use the Smart Compile Auto Correction feature
As you learned in figure 3-9, Visual Studio puts a wavy line under any syntax errors that it detects while you’re entering code. In some cases, though, Visual Studio takes that one step further with its Smart Compile Auto Correction feature. In those cases, a bar appears at the right end of the wavy underline.
To use this feature, you place the mouse pointer over this bar to display a smart tag. Then, you can click the drop-down arrow that appears to display the Error Correction Options window shown in figure 3-13. This window includes a description of the error, suggestions for correcting the error, and a preview of how the code will look if you apply the corrections. If you like the suggested corrections, you just click on the suggestion to apply them.
For this example, I set the Option Strict option on, which you’ll learn how to do in the next chapter. Because that forces you to do some data conversion before comparisons or arithmetic calculations can be done, the suggested changes do those data conversions. This illustrates the power of this feature, so you’re going to want to use it whenever it’s available.
The Code Editor with the Error Correction Options window displayed

Description
When Visual Studio detects a syntax error, it highlights the error with a wavy underline in the Code Editor.
If a bar appears at the right end of a wavy underline, you can use the Error Correction Options window to view and apply suggested corrections.
To display the Error Correction Options window, place the mouse pointer over the bar, then over the smart tag that’s displayed, and click the drop-down arrow.
To apply a correction, click the appropriate “Replace…” link.
Note
Figure 3-13. How to use the Smart Compile Auto Correction feature
Next: How to use the My feature >>
More Visual Basic.NET Articles
More By Murach Publishing
|
This article is excerpted from chapter three of Murach's Visual Basic 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774456). Check it out today at your favorite bookstore. Buy this book now.
|
|