Pages

Friday, May 10, 2013

Lesson 4: Learn Intellisense of Visual Studio 2010

This lesson series I will teach you the basics of how to use Microsoft Visual Studio IDE with graphical examples.

In previous lesson I teach you Simple Tips of Visual Studio 2010 and how to use them in useful manner.

Now I’m going to tell you about the intellisense of the VS2010 and how to use it in the coding and the design. Getting know about the VS2010 IDE well means you can use it well for your future coding practices very easily.

What is Intelisense?

IntelliSense is the general term for a number of features: List Members, Parameter Info, Quick Info, and Complete Word. These features help you to learn more about the code you are using, keep track of the parameters you are typing, and add calls to properties and methods with only a few keystrokes. 

Many aspects of IntelliSense are language-specific. For more information about IntelliSense for different languages. It makes simple to coding and it makes simple to learn about the entire syntaxes, parameters and the properties that VS2010 helps for the C#.

Intellisense is available any version of VS and languages like VB, C#, ASP.NET, ADO.NET and so on. This is invented by Microsoft itself to help programmers and make them more effective with make them faster coders.
  •  List Members
A list of valid members from a type (or namespace) appears after you type a trigger character (for example, a period (.) in managed code or in C#). If you continue typing characters, the list is filtered to include only the members that begin with those characters.

After selecting an item, you can insert it into your code by pressing TAB or by typing a space. If you select an item and type a period, the item appears followed by the period, which brings up another member list. When you select an item but before you insert it, you get Quick Info for the item.

In the member list, the icon to the left represents the type of the member, such as namespace, class, function, or variable. For a list of icons, see Class View and Object Browser Icons. The list may be quite long, so you can press PAGE UP and PAGE DOWN to move up or down in the list.

 
You can invoke the List Members feature manually by typing CTRL+J, clicking Edit/IntelliSense/List Members, or clicking the List Members button on the editor toolbar. When it is invoked on a blank line or outside a recognizable scope, the list displays symbols in the global namespace.

To turn List Members off by default (so that it does not appear unless specifically invoked), go to Tools/Options/All Languages and deselect Auto list members. If you want to turn off List Members only for a specific language, go to the General settings for that language.

You can also change to suggestion mode, in which only the text you type is inserted into the code. For example, if you enter an identifier that is not in the list and press TAB, in completion mode the entry would replace the typed identifier. To toggle between completion mode and suggestion mode, press CTRL+ALT+SPACEBAR or click Edit/IntelliSense/Toggle Completion Mode
  • Parameter Info
Parameter Info gives you information about the number, names, and types of parameters required by a method, attribute generic type parameter (in C#), or template (in C++). 


The parameter in bold indicates the next parameter that is required as you type the function. 

For overloaded functions, you can use the UP and DOWN arrow keys to view alternative parameter information for the function overloads.  


When you annotate functions and parameters with XML Documentation comments, the comments will display as Parameter Info. For more information, see Supplying XML Code Comments.

You can manually invoke Parameter Info by clicking Edit IntelliSense/Parameter Info, typing CTRL+SHIFT+SPACE, or clicking the Parameter Info button on the editor toolbar. 
  •  Quick Info 
Quick Info displays the complete declaration for any identifier in your code.  


 


When you select a member from the List Members box, Quick Info also appears.  


You can manually invoke Quick Info by clicking Edit/IntelliSense/Quick Info, typing CTRL+I, or clicking the Quick Info button on the editor toolbar.

If a function is overloaded, IntelliSense may not display information for all forms of the overload.
You can turn Quick Info off In C# by setting Tools/Options/Text Editor/C/C#/Advanced/Auto Quick Info to false.
  •  Complete Word 
Complete Word completes the rest of a variable, command, or function name once you have entered enough characters to disambiguate the term. You can invoke Complete Word by clicking Edit/IntelliSense/Complete Word, typing CTRL+SPACE, or clicking the Complete Word button on the editor toolbar. 
  • IntelliSense Options 
IntelliSense options are on by default. To turn them off, click Tools/Options/Text Editor and deselect Parameter information or Auto list members if you do not want the List Members feature.
  •  Troubleshooting IntelliSense 
The IntelliSense options may not work as you expect in certain cases.

The cursor is below a code error.   You might not be able to use IntelliSense if an incomplete function or other error exists in the code above the cursor because IntelliSense might not be able to parse the code elements. You can resolve this problem by commenting out the applicable code.

The cursor is in a code comment.   You can't use IntelliSense if the cursor is in a comment in your source file.

The cursor is in a string literal.   You can't use IntelliSense if the cursor is in the quotation marks around a string literal, as in the following example:

MessageBox( hWnd, "String literal|") )

The automatic options are turned off.   By default, IntelliSense works automatically, but you can disable it. Even if automatic statement completion is disabled, you can invoke an IntelliSense feature.
If you change your IntelliSense settings, then your new settings will apply to IntelliSense in both the Code Editor and the Immediate Mode Command Window.
  • To turn IntelliSense options OFF by default
 1. On the Tools menu, click Options.
 2. Select the Text Editor folder.
 3. Select the folder for the language you want to customize IntelliSense.
 4. In the General property page, clear check boxes for IntelliSense features that you do not want:
        o Auto list members applies to List Members 
        o Parameter information applies to Parameter Info

When you do your coding this intellisense will appear all the time, try to use it maximum to speed up your coding well and always read the comments given by the intellisense, which will make you learn more. 

Most Importantly C# is case sensitive language, therefore make sure use proper way to declare the names and when intellisense show them while coding, select the required things carefully.

This is brief overview about the VS2010, which will give you the basic tips of VS2010 to you. Hope it will help you lot. 

Any Questions??
Mail me: call.rohana@gmail.com 

For more IT & IS related topics visit www.uncopyrightables2011.blogspot.com

Lesson 3: Simple Tips of Visual Studio 2010


This lesson series I will teach you the basics of how to use Microsoft Visual Studio IDE with graphical examples.

In previous lesson I teach you what the Visual Studio 2010 functions are and how to use them in useful manner.

Now I’m going to tell you about the simple tips of the VS2010 and how to use them in the coding and the design. Getting know about the VS2010 IDE well means you can use it well for your future coding practices very easily.

Canvas: 

 After creating the project you can see this view in the IDE, this is the design view of the project, this Form is called as canvas. This canvas can be resize according to the application by just select the corner and dragging it or go to properties and change the value. You can put any tool which is available in the Toolbox (you can see it in the left hand corner). 

If you double click the tool or just drag & drop that tool in to the canvas will draw the selected tool in the canvas. Size of the tool can be change select the tool and change its size using mouse or go to properties and change the values.






Solution Explorer:

Here shows each an everything that you create, import in the project. Don’t delete Program.cs which is a must in every project.

Here you can see the design view file (Form1.cs) and the code view file (Form1.Designer.cs) separately. According to your need you can view them one at a time. You can add new form or file just right click the Application name (My First Application) and select the necessary. You can add existing item or the reference in the same way too.







You can change the properties of whatever the tool or the form any time according to the need. Here you can see the properties in categorized view if you select the left most icon, or alphabetical order in the current status. But make use do not change the name properties during the coding, others may acceptable.







Code View:

Here you can see the code view of one of the form in the project. Different words in different colors, there is a reason for that I will explain you in later lesson.










Toolbars:

This toolbars are really important for you to save, edit, undo, redo or do many actions to the code and the project easily. Most of the functions are in graphical format, then programmer can easily understand them and get the use of them rather than memorizing and go to the list or the menu and select them.

The green triangle is the run button, which run the project. If there is any errors it will show them with the reason and the line. Then programmer can easily correct them in order to the guidance given by the IDE.

Project can run in debug mode or release mode. According to the programmers need it can change, but project files save in two different folders for different purposes.

Error List:

Errors will display here when you run the program, then the error, description, line, column and the project also display here. Then programmer can easily find where is it and what is it and what should be the solution for that also.

Intermediate Window:

Here all the outputs of the code will show to the programmer. Some projects files doesn’t contain Forms. Therefore those kind of files may have some calculations or algorithms which may give outputs. All those outputs will display here, then programmer can identify what are they and are the correct according to the code or not. Sometimes code may run successfully but content may change according to required code.

Output Window:

This is the final out put that we can see in the form based project. Simple but fully functional software output can be experienced here with the live user experience too.













This is brief overview about the VS2010, which will give you the basic tips of VS2010 to you. Hope it will help you lot.

Any Questions??

For more IT & IS related topics visit www.uncopyrightables2011.blogspot.com