IntelliSense for Most Frequently Used Members
IntelliSense is designed to preselect members that are most frequently used during automatic completion. This allows you to immediately proceed on the desired item, without wasting time typing out its name or browsing through a list of infrequently used members in the pop-up List Members box.
This example shows how to clear the history of previous frequently used members and then use IntelliSense for new members using the WriteLine method.
To clear the history of MFU members
- In the Visual Studio IDE, click Tools, and then click Options.
- Expand the Text Editor node, then expand the C# node, and then select Formatting.
- Click the Clear history button to clear the history of members that you have previously used during automatic object name completion.
To use IntelliSense for MFU members
- Create a new console application.
- In the Code Editor, type
The List Members box appears after you type the scope operator (.). IntelliSense automatically selects the first member of the Console class that begins with a W, which is the Write method.
Note If you do not want to use the default selection and you would rather continue with a different method, such as the WriteLine method, then you must continue typing the object name until it is disambiguated or press the DOWN ARROW key until the desired member is selected.
- In the List Members box, select the WriteLine method.
- Press ENTER for automatic object name completion, and then complete the rest of the statement. For example:
Console.WriteLine("IntelliSense preselected Write.");
Console.Win the Code Editor again.
Because the WriteLine method becomes the most frequently used member of the Console class, IntelliSense already selects this method in the pop-up list box.
Note Now you can immediately proceed on this method without having to type out the rest of its name or browse the List Members box for the WriteLine method.
- Press ENTER, and then complete the rest of the statement. For example:
Console.WriteLine("IntelliSense preselected WriteLine.");