Hiding the Shape Search Window in Stencil Window

Hiding the Shape Search Window in Stencil Window

Post by S2FubmFuLk » Wed, 10 Dec 2003 14:06:05


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
 
 
 

Hiding the Shape Search Window in Stencil Window

Post by Dawn Wrigh » Wed, 31 Dec 2003 08:47:50

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.



hide the shape search window in the stencil pane. I found this line of code
in msdn,
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.