Open only stencil in drawing control

P

Padmakar Bhosale

Hello
Can we open on stencils in drawing control ( without drawing explorer).

Thanks

Padmakar Bhosale
 
C

Chris Roth

Hi Padmakar,


I think you've got two possibilities with the control:

1. Hide the "Shapes" window
2. Open stencils invisibly.


Examples:


1. This code shows all the sub-windows in a Visio drawing window:

Sub Windows()
Dim w As Visio.Window
For Each w In Visio.ActiveWindow.Windows
Debug.Print w.ID, w.Caption
Next
End Sub

1658 Custom Properties
1653 Pan & Zoom
1670 Size & Position
1669 Shapes
1721 no caption ( but it's the Drawing Explorer window)

So if you close window 1669 "Shapes", then your stencils will not be visible
in the Visio control.

Do it like this:


Sub ToggleWindow()
Dim w As Visio.Window
For Each w In Visio.ActiveWindow.Windows
If w.ID = 1669 Then w.Visible = Not (w.Visible)
Next
End Sub




2. visio.Documents.OpenEx( "Basic Flowchart Shapes.vss", visOpenRO +
visopendocked + visopenhidden)


--

Hope this helps,

Chris Roth
Visio MVP
 
C

Chris Roth

Hmm. I've never tried getting the window handle of a stencil window and
trying to reassign it to another panel. Might be worth a shot.

What I have done many times, and is similar to what you need to do is to use
DoDragDrop with a tree control.f So I have various tree elements that the
user can drag into a drawing, but they need to "serve up" a Visio master.

A snippet looks like this:

Sub theTree_TreeNodeDragged(....)

Dim m As Visio.Master = visDoc.Masters("Bob")

Dim dde As DragDropEffects = theTree.DoDragDrop( m,
DragDropEffects.Copy )

End Sub

You could build any kind of list or explorer control with text or icons or
anything (a *better* stencil!)

--

Hope this helps,

Chris Roth
Visio MVP
 
P

Padmakar Bhosale

Hello Chris Roth
Thanks for replay. I will try what you suggested.

Padmakar Bhosale
 

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