Hiding the Shape Search Window in Stencil Window

K

Kannan.M.R

Hi,
I am using with visio activex control in windows forms. I am trying to hide the shape search window in the stencil pane. I found this line of code in msdn,

windows(1).ItemAtID(visio.viswinidshapesearch).visible = false.

This piece of code says that we can hide the shape search window in the stencil pane. But since i am using c#, i am not able to use the above piece of code. This is because "windows" is supposed to be a class and not an object. Please guide me as to what can be done.


Kannan
 
D

Dawn Wright [MSFT]

Kannan,

Here's a snippet of code that should work:

/// <summary>This method sets the visibility of the shape search window.
/// </summary>
/// <param name="targetWindow">Reference to the window that will contain
/// the shape search window.</param>
/// <param name="visible">Show or hide the shape search window.</param>
public void SetVisible(
Microsoft.Office.Interop.Visio.Window targetWindow,
bool visible) {

// Verify that the window object is valid
if (targetWindow == null) {

throw new System.ArgumentNullException("targetWindow",
"Null object input.");
}

Microsoft.Office.Interop.Visio.Window searchWindow;
searchWindow = targetWindow.Windows.get_ItemFromID(
System.Convert.ToInt16(Microsoft.Office.Interop.Visio.
VisWinTypes.visWinIDShapeSearch,
System.Globalization.CultureInfo.CurrentUICulture));

if (searchWindow != null) {
searchWindow.Visible = visible;
}
}

--
Dawn

This posting is provided "AS IS" with no warranties, and confers no rights.

Kannan.M.R said:
Hi,
I am using with visio activex control in windows forms. I am trying to
hide the shape search window in the stencil pane. I found this line of code
in msdn,
windows(1).ItemAtID(visio.viswinidshapesearch).visible = false.

This piece of code says that we can hide the shape search window in the
stencil pane. But since i am using c#, i am not able to use the above piece
of code. This is because "windows" is supposed to be a class and not an
object. Please guide me as to what can be done.
 

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