Custom "Properties" dialog

T

Tiret Ohf D.

Hi everybody,

by adding rows to the Custom Properties section of shapesheet I can add
user controls to the *standard* Properties dialog. However, I want to
create a custom dialog that is more sophisticated than the straight one
that Visio offers.

I think, there are 2 approaches (thanks to John Marshall): edit final
vss as vsd and inject VBA code into OR create own add-in and attach it
to the Addins collection of Application.

Is there other ways to do custom properties dialog?

Thanks.

--T.
 
J

John

Tiret,

It depends what you want to achieve. John Marshall's advice of keeping your
code (and forms) in a stencil is a sound one. This keeps the code in a
single location and means that you can generate new documents (perhaps based
on a template) and when you want to change the code you don't have to change
it in multiple documents.

So in terms of your creating your own custom properties dialog, you can add
a form module to the stencil (within the VBE) with various controls on that
form. If you add a CallThis function to the double click event cell in you
master shapes, then it can open the form.

So, in the shapesheet cell:
CallThis("MyProcedureName", "YourStencilName")

Then in the code in your form you have something like:
Sub TiretCustomProperties(ByRef shpIn As Shape)
....and so you automatically have a reference to the shape ("shpIn")
that was double clicked.
So for example:
Me.Controls(txtBox).Value = shpIn.Cells("Prop.ShapeName").ResultStr("")

The only draw back of this method is if you want to use complex controls
such as clever TreeViews or DataGrids which don't appear in the VBA
environment.

Anyway, hope this helps.

Best regards

John (not Marshall!)
 
T

Tiret Ohf D.

Thanks, John. I see it already that VBA forms even doesn't support XP
Themes. Since I use Visio drawing as the part of a bigger program, I
think it would be better if I write own addon say, in C# or C++ and
attach resulting .dll to Visio drawing when needed to get all this
extra functionality (XP Theme, TreeView etc.)

--T.
 
V

vojo

I have done this strictly in a shapesheet (no VBA). Basically, you create
two variable in a user cells that gates which custom properties to present
and where the flow is at. The input to custom properties is used by other
user cells to modify the variables and then call docmd(1312).

For example, I have used this to ask the user which chassis to use, then
based on
his answer, which slots to use, then based on that which functions in those
slots.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top