You can add members to class diagram elements (containers) by using the respective context menu for the diagram element in the Diagram or Model Views or available shortcut keys to add members to a class diagram container element.
To add a member to a container:
- Right-click the container (class, interface, and so on).
- Choose Add(Member_type).
Tip: You can also use keyboard shortcuts to add fields and methods to a container allowing such members. Click CTRL+W (for fields) and CTRL+M (for methods, functions).
- You can edit the member using the in-place editor, Object Inspector, or source code editor.
Result: The new member is placed in the compartment of the container in the sort order for the elements in your diagrams. You can set the sort order in the Options
Tip: If a container already has members, you can right-click the existing member to create an additional member using the context menu. You can also select the member, and press INSERT