Share via


How to: Add a Parameter to a Method

You can add a parameter to a method using the Class Details window.

Note

   To add a parameter to a delegate, see How to: Create a Member.

Note

   Although a destructor is a method, it cannot have parameters.

To add a parameter to a method

  1. On the diagram surface, click the type containing the method to which you want to add a parameter.

    The type obtains focus and its contents display in the Class Details window.

  2. In the Class Details window, expand the row of the method to which you want to add a parameter.

    An indented parameter row appears, containing only a pair of parentheses and the words <add parameter>.

  3. Click <add parameter>, type the name of the new parameter, and press Enter.

    The new parameter is added to the method and the method’s code. It displays in the Class Details window and the Properties window.

  4. Optionally, specify other details about the parameter, such as its type.

See Also

Tasks

How to: Modify Type Members

Concepts

Creating Type Members

Keyboard Shortcuts for the Class Details Window