How can you hide Search Shape window in Visio ActiveX Control?

H

H Wu

I added Visio ActiveX control on a form and set a ActiveX property HostID to
a GUID {FA472342-324K-2DF2-2A42-983EA32423}, this put GUID in the registry.
I put following codes:
m_ovWindow = oaVisioControl.Window;
m_ovWindow.Document.Application.Documents.OpenEx("Temp.vsd",
(short)Visio.VisOpenSaveArgs.visOpentDontList);
//Hide the Search Shape controls works here but when I open the stencils it
reopen Shape Search window and docked the stencils on it.
m_ovWindow.Windows.get_ItemFromID((int)Visio.VisWinTypes.visWinIDShapeSearch).Visible = false;

I can't figure out why this happen. So I removed GUID off the HostID
property of the ActiveX Control and it work. Why?? I thought putting a GUID
on HostID property let individual application controls UI of the activex
control.
 
H

H Wu

Ok finally figured it out and its tricky no where is it documented in
Microsoft.
Basically you to call this line of code after activex control or form where
activex control resided:
m_ovWindow.Windows.get_ItemFromID((int)Visio.VisWinTypes.visWinIDShapeSearch).Visible = false;
 
M

Michel LAPLANE

You must iterate through all the windows and hide all nondrawing window.
Look at the graham wideman book (Visio 2003 survival pack) you can find the
code KillNonDrawingWindows at page 371.
 

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