Opening/closing stencil pane

O

Olaf Lischke

Hi there,

I'm desperately looking for any method for showing/hiding or opening/closing
the stencil pane on the left side of a visio drawing.

Visibility of the stencils can be toggled by:

Private Sub StencilWindowVisible(ByVal targetWindow As Visio.Window,
ByVal Visible As Boolean)
Dim stencilWindow As Visio.Window
Try
For Each stencilWindow In targetWindow.Windows
If stencilWindow.Type =
Visio.VisWinTypes.visDockedStencilBuiltIn Then
stencilWindow.Visible = Visible
End If
Next
Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex.Message)
End Try
End Sub

But the stencil pane itself is still there and that looks wierd.

Thx
Olaf
 
J

JuneTheSecond

Hi, Olaf.
You might need to use visWinIDShapeSearch, simply
Visio.Application.ActiveWindow.Windows.ItemFromID(visWinIDShapeSearch).Visible = True (or False).
 
J

JuneTheSecond

Sorry, correct code might be
Visio.Application.ActiveWindow.Windows.ItemFromID(Visio.VisWinTypes.visWinIDShapeSearch).Visible = True.
 
O

Olaf Lischke

Yes, John,

I'm aware of that and already able to access DoCmd from VB.NET as well
(quite tricky via IOleCommandTarget implementation), but in this case my
application needs to know wether the Stencil pane is visible or not - that's
some kind of a hack, not my idea of elegant coding...

CU
Olaf
 
O

Olaf Lischke

Sorry June, I'm not talking about the ShapeSearch but the entire window with
the Shapes in it on the left side of a Visio window. Beside the title
"Shapes" there's a small closing "x", so there must be some Visio function to
open and close it...
 
J

John Goldsmith

Apologies for my inelegant solution. You might want to stipulate your
required level of elegance in the question :)

Anyway, if straight toggling doesn't work for you then JuneTheSecond's
answer is correct - visWinIDShapeSearch is the id for the Shapes window.

Best regards

John


John Goldsmith
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk
 

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