Modal form in visio

C

Chris Roth [ Visio MVP ]

According to one expert I know, there is no real easy way to do this with
out-of-process solutions (ie: VB exes)

Check out Graham Wideman's book at: www.diagramantics.com

If you buy the book, he has an adapter that allows you to load VB.EXEs as
in-process add-ons. This is very cool, and should help you to make your
modal dialogs...

--

Hope this helps,

Chris Roth
Visio MVP
 
M

Markus Breugst

Hi Alejandro,

we "simulate" a modal dialog by "locking" Visio and afterwards creating the
dialog from our application. Here's a C# example.

After executing the following line of code, Visio's GUI is locked, that
means no more user input is accepted and the application seems to be dead:

visioApp.OnComponentEnterState(
VisOnComponentEnterCodes.visComponentStateModal |
VisOnComponentEnterCodes.visModalDisableVisiosFrame |
VisOnComponentEnterCodes.visModalDontBlockMessages, true );


Use this line to revive the GUI:

visioApp..OnComponentEnterState(
VisOnComponentEnterCodes.visComponentStateModal, false );


If you have AutoSave enabled, Visio may have problems to save a document
while the application is locked. In this case, switch AutoSave off before
locking and switch it on after unlocking Visio. You can achieve this by
setting the auto recovery interval:
visioApp.AutoRecoverInterval = 0;

Hope this helps.

Best regards,
Markus
 

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