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

  1. In the Visual Studio IDE, click Tools, and then click Options.
  2. Expand the Text Editor node, then expand the C# node, and then select Formatting.
  3. 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

  1. Create a new console application.
  2. In the Code Editor, type Console.W in the Main method.

    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.
  3. In the List Members box, select the WriteLine method.
  4. Press ENTER for automatic object name completion, and then complete the rest of the statement. For example:
    Console.WriteLine("IntelliSense preselected Write.");
  5. Type Console.W in 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.
  6. Press ENTER, and then complete the rest of the statement. For example:
    Console.WriteLine("IntelliSense preselected WriteLine.");

See Also

Visual C# IntelliSense