Visio 2003 Developer's Survival Pack Tools and Samples

Chapter 26: Visio Drawing Control (VB6)
Visio 2003 DSP home   This page

Overview

The purpose of this sample is illustrate some basic operations using the Visio Drawing Control on a VB6 Form.

Installation

This sample obviously requires Visual Basic 6, and Visio 2003.

Files

File Description
Generic_VBVDC.vbp Main project file. Double-click to invoke VB6 and load project.
Form1.frm The main form on which is located an instance of the Visio Drawing Control, and some other features.
Generic_VBVDC.exe The actual executable resulting from the project.
MyStartDoc.vdx A Visio document that the executable loads on startup to initialize drawing control's environment.
SampleDoc.vdx A sample Visio doc that you can load

Operation

You can run the application either from within the VB6 IDE, or by launching the exe from Windows Explorer.

Try the following exercises.

Exercise Description
File > New Reloads startup document. That document can act to initialize various display and drawing characteristics
File > Clear Doc Deletes all existing shapes on the control's drawing
File > Open... Loads an existing Visio file into the drawing control
File > Save, Save As Saves drawing control's contents to a file
Open Basic Shapes button Opens the Basic Shapes stencil
Tidy Windows button Gets rid of unwanted windows, for example the Shape Search area
Random Colors button Drag some shapes onto the page, then hit the Random Colors button to fill the shapes with random colors.
Track Mouse checkbox If you check this box, then the app will watch Mouse Move events. If the mouse moves over a shape, the app will color it red.
Watch Drop button Causes app to listen for Shape Added events. Reports name of shape dropped to a label beside the button.

See Also

VS.NET C# version of this example.


Article Created: 2003-09-01  Last edit: Last edit: 03-10-15 Graham Wideman
Go to:
  DiagramAntics.com