How to get rid of stencil window on left in drawing control?

0

0rbital

What is it actually called? I can get rid of the Shape Search like this:

Visio.Window winShapeSearch =
axDrawingControl1.Window.Windows.get_ItemFromID((int)Visio.VisWinTypes.visWinIDShapeSearch);

winShapeSearch.Visible = false;

but I can't get rid of the actual stencils/shapes. My users will have no
need to be dropping shapes onto the P&ID I just want to display the drawing,
I can hide it of course after the application starts by clicking on it. How
can I do it during the form load?
 
J

JuneTheSecond

Hi 0rbital,

You are right, it dose not work in VBA, either.
Would you please DoCmd with visCmdShapesWindow.
DoCmd is a method of Visio.Application.
 
0

0rbital

Thanks for the tip. That worked. To get rid of the shapes window you can
use this command:

//get rid of shapes window
vsoApp.DoCmd(1669);
 
J

JuneTheSecond

0rbital,

Thank you for your information.
vsoApp.DoCmd(1669); is a toggle switch
that can not only Off the stencil window
but also On it.
 
S

sorina.negulescu

Thanks for the tip.  That worked.  To get rid of the shapes window youcan
use this command:

//get rid of shapes window
vsoApp.DoCmd(1669);

If I understand correctly, that command closes the shapes window if
visible, and brings it up if not.
Is there any way to (programmatically) tell if the shapes window is
visible in the first place, so I can invoke the command only in that
case?
 
A

AlEdlund

when I need that type of information I usually 'cheat' by opening the object
browser in the vba editor. For this type of problem I look for 'visWinTypes'
to figure out which windows I want to work with and then use the
'visWindowStates' for testing. I suspect you're looking for the
'visWsVisible' state.
al

Thanks for the tip. That worked. To get rid of the shapes window you can
use this command:

//get rid of shapes window
vsoApp.DoCmd(1669);

If I understand correctly, that command closes the shapes window if
visible, and brings it up if not.
Is there any way to (programmatically) tell if the shapes window is
visible in the first place, so I can invoke the command only in that
case?
 

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