Controlling Shapes in Visio Using Drop Down Lists
Part two of a five-part series of blogs

Microsoft Visio lets you create far more than simple static diagrams. In this blog series we show you how to use Shape Data and the ShapeSheet to create a dynamic shape that will change its dimensions when you choose a value from a drop down list.

  1. Controlling Shape Size in Visio Using Drop Down Lists
  2. Creating Drop Down Lists in Visio Shape Data (this blog)
  3. Calculating Shape Properties in the ShapeSheet
  4. Using IF Functions and Comparing Text in Visio
  5. Protecting the Contents of the ShapeSheet

Posted by Andrew Gould on 21 June 2012

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Creating Drop Down Lists in Visio Shape Data

The next step in creating our fancy, dynamic shape is to give users the ability to select a size option from a drop down list.  To achieve this we're going to add a property to the Shape Data.

Viewing Shape Data

Lots of shapes in Visio already have a set of properties, referred to as Shape Data, which you can view and edit.  One easy way to see the properties that a shape has is to view the Shape Data window.  To do this, from the menu choose: View > Shape Data Window.

Shape data window

When you select a shape, the Shape Data window displays the properties belonging to the shape. This rectangle doesn't have any properties yet so we'll need to create some.


Creating Shape Data Properties

You can add properties to a shape by right-clicking on it and choosing the options shown in the diagram below:

Viewing shape data

Choose Data > Shape Data... to begin adding new properties.


If the shape doesn't have any properties you'll be asked if you want to create some.  Click Yes on the dialog box that appears.

Choosing to add shape data

Click Yes to add shape data properties.


The dialog box that appears allows you to create all of the properties that you want your shape to have.  The next section explains how to create a simple drop down list to choose a shape size.

Creating a Drop Down List Property

The diagram below shows how to create a simple drop down list in our rectangle shape:

Defining properties

Use this dialog box to define the property. The numbered steps are described below.

  1. Type in a name for the property.
  2. Choose the type of property you want to create. Use Fixed List to create a drop down list with a fixed list of choices.  You can also use Variable List if you want users to be able to type in additional choices later.
  3. For our list we need to type in the different choices separated by semi-colons.
  4. You can optionally provide a default value for the property.  For a fixed list you need to make sure that this is one of the options in the list.
  5. The Prompt is optional and can provide users with more information on what the property is for.
  6. If you wanted to add more properties you can click the New button and repeat steps 1 - 5.  Here we're going to click OK as we don't need any extra properties.

When you click OK you'll be taken to another dialog box showing you the properties that you've created for the selected shape.

Choosing a shape data value

You can choose an option from the drop down list and click OK to close the dialog box.


You will also be able to see and change the property in the Shape Data window:

Using the Shape Data window

Click on the shape to make its properties appear in the Shape Data window.


Editing Shape Data Properties

If you want to make changes to the shape data properties you've created you can.  To do this, right-click on the shape and choose the option shown in the diagram below:

Choosing to edit shape data

Choose this option to view the shape's existing properties.


On the next dialog box click Define... to edit the existing properties or create new ones.

Editing shape data properties

Click Define... to modify the shape's properties.


When you click Define... you'll be taken back to the dialog box you used to create the property to begin with.

Modifying properties

You can make any changes to the existing properties or create new ones and then click OK.

What's Next?

We now have a shape with a drop down list that allows us to select one of three sizes.  At this point, however, choosing an option from the list doesn't actually modify the shape size.  To solve this we need to learn how to work with the ShapeSheet and create a calculation that will change the size of the shape.  Read the next part of this series to find out how to do this.

This blog has 0 threads Add post