Home > Sample chapters

Add Structure to Your Diagrams in Microsoft Visio 2016

Organize shapes by using containers

Grouped shapes are still valuable for many purposes, including holding collections of subshapes that are unlikely to change. However, Visio containers offer numerous advantages, especially for dynamically grouping, moving, and managing a set of related shapes.

One regular ribbon tab and one tool tab are vital for working with containers. The Insert tab, shown in Figure 13-6, is home to the Container gallery, which you use to add containers to a page.

Figure 13-6

Figure 13-6 The Container gallery offers 14 container styles

You use various functions on the Format tool tab in the Container Tools tab group, shown in Figure 13-7, to manage containers in ways you will explore in the sections of this topic.

Figure 13-7

Figure 13-7 The Format tool tab appears only when you select a container

Use containers

You can create an empty container and add shapes to it later, or you can create a container around existing shapes. In either case, your containers can appear in a variety of styles. Figure 13-8 shows the same set of network shapes in five different containers to illustrate the range of choices.

Figure 13-8

Figure 13-8 Examples of diverse container styles from simple to highly stylized

Containers provide visual feedback while you interact with them. As shown on the left in Figure 13-9, dragging a shape into a container causes the border of the container to “light up” in green. This type of feedback is a way to distinguish a container from a group or an ordinary shape.

Figure 13-9

Figure 13-9 Adding or selecting shapes highlights the surrounding container

The container border also lights up when you select any contained shape, as shown on the right in Figure 13-9. This behavior is evidence of the relationship between containers and members that was described in “Understand containers, lists, and callouts” earlier in this chapter.

Because containers were designed to remain connected to their members, it’s easy to copy or delete both as a unit by selecting the container. The only trick when selecting the container is to remember that the body of a container is invisible to mouse clicks. You must click the header or one of the edges to select it.

If you want to copy or delete just the members but not the container, that’s also easy because there are several techniques for selecting all members of a container—then you can just copy or delete the shapes in the usual way.

To delete the container but leave its contents behind, you could drag the contents out and then delete the container. However, Visio provides a Disband Container command for this purpose.

To place an empty container on the page

  1. On the Insert tab, in the Diagram Parts group, click Container.
  2. In the Container gallery, click the thumbnail of the container type you want.

To contain existing shapes

  1. Select one or more existing shapes, and then do one of the following:

    • Display the Container gallery, and then click the thumbnail of the container type you want.
    • Right-click one of the selected shapes, and then click Add to New Container.
    • If the shapes are on top of, but are not members of, a container, right-click one of the selected shapes, and then click Add to Underlying Container.

To add shapes to a container

  1. Drag one or more shapes into the container.

Or

  1. Do either of the following:

    • Resize a container until it covers the shapes you want to add.
    • Drag a container until it’s on top of the shapes you want to add.
  2. Right-click one of the shapes, and then click Add to Underlying Container.

To select a container

  1. Do either of the following:

    • Click the heading section of the container.
    • Click any edge of the container.

To select all contained shapes

  1. Do either of the following:

    • Select the container, and then on the Format tool tab, in the Membership group, click the Select Contents button.
    • Right-click any edge of the container, point to Container, and then click Select Contents.

To remove shapes from a container

  1. Drag the shape you want to remove until it is outside the container.

To delete a container but leave contained shapes

  1. Do either of the following:

    • Select the container, and then on the Format tool tab, in the Membership group, click the Disband Container button.
    • Right-click any edge of the container, point to Container, and then click Disband Container.

To lock or unlock a container

  1. Do either of the following:

    • Select the container, and then on the Format tool tab, in the Membership group, click the Lock Container button.
    • Right-click any edge of the container, point to Container, and then click Lock Container.

Format containers

When you drag a container onto the page, it includes a set of predefined style attributes. You can change some of the most visible container attributes by using the commands on the Format tool tab that is shown in Figure 13-7. You can alter other container characteristics by using buttons on the other Visio tabs.

Container attributes you can alter include the following:

  • You can switch to another of the 14 container styles.
  • You can choose alternate heading styles; Visio offers either two or four heading styles per container type. You can also hide the heading.
  • You can select different themes, variants, and effects. Because containers respond to those changes, the appearance of the containers on your drawing page (and their thumbnails in the gallery) can be very different from one diagram to the next.
  • You can change the fill, line, and shadow attributes of a container as you would any other Visio shape.

To choose a different container style

  1. Do any of the following:

    • On the Format tool tab, in the Container Styles group, display the Container Styles gallery.
    • On the Home tab, in the Editing group, click the Change Shape button.
    • Right-click the heading or edge of the container, and then on the mini toolbar, click the Change Shape button.
  2. Click the container style you want.

To choose a different heading style

  1. On the Format tool tab, in the Container Styles group, click the Heading Style button.
  2. In the Heading Styles gallery, click the thumbnail of the heading style you want.

To hide the heading

  1. Display the Heading Styles gallery, and then in the No Heading section, click the No Heading thumbnail.

Control container size

Visio containers expand automatically when you add shapes near the edge of the container. You can change this default behavior by using the Automatic Resize button located in the Size group on the Format tool tab. Clicking the Automatic Resize button, which is shown in Figure 13-7, reveals three mutually exclusive options:

  • No Automatic Resize The container does not expand when you drag shapes near the edge.
  • Expand as Needed The container expands when you drop shapes near the edge. Note that the opposite is not true—the container does not shrink when you remove shapes.
  • Always Fit to Contents The container expands and contracts automatically when you add or remove shapes.

You can also affect container size by using the other buttons in the Size group:

  • Margins Sets the spacing between the edges of the container and the contained shapes
  • Fit to Contents Sets the container size to the minimum required for the contained shapes plus the margin