How to Close Shapes Palette

S

shailendrasingh823

Hi All,

I want to close Shapes Palette(window) for this I am trying to use
following options
(1) newDocument.Application.DoCmd(1669).
(2) Application.DoCmd(1669).
Because I am no geeting any how constant visCmdShapesWindow opotion.

So when i execute these statements I am geting "Request Operation is
presently disabled" .

if any body knows abt the solution please let me know.

shail
 
J

JuneTheSecond

It might be
AxDrawingControl1.Window.Application.DoCmd(1669) or
AxDrawingControl1.Document.Application.DoCmd(1669)
 
S

shailendrasingh823

It might be
AxDrawingControl1.Window.Application.DoCmd(1669) or
AxDrawingControl1.Document.Application.DoCmd(1669)

Hi June,

Thanks for ur reply,But unfortunately I am getting same error for both
statements.
Please find my code I think it will help u understand

internal static bool
GenerateDrawing(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
drawingControl1,
VisioComponent.ShapeInfoStruct[] shapeinfo,
VisioComponent.ConnectionInfoStruct[] connectioninfo, string
_DocumentStensilPath)
{
bool result = false;
try
{

if (drawingcontrol != null)
drawingcontrol = null;
if (shapeArray!= null)
shapeArray = null;
if (connectionArray != null)
connectionArray = null;
drawingcontrol = drawingControl1;
Visio.Document newDocument = null;


drawingControl1.Src = _DocumentStensilPath;

drawingControl1.Document.Application.DoCmd(1669);

//DocumentStensil = _DocumentStensilPath;
newDocument = drawingControl1.Document;


drawingControl1.Window.ShowGrid = 0;
drawingControl1.Window.ShowRulers = 0;
drawingControl1.Window.ShowScrollBars = 0;
drawingControl1.Window.ShowPageTabs = false;
drawingControl1.Window.Zoom = 0.7;

//drawingControl1.Window.BackgroundColor = vbWhite;

///////Close Shapes Window///

Visio.Application myapplication=
drawingControl1.Window.Application;

//myapplication.DoCmd(Visio.);

Visio.Documents mydocuments = myapplication.Documents;

Visio.Windows mywindows =
myapplication.Windows[1].Windows;

Visio.Window window = null;

short numwindows = mywindows.Count;

for (short i = 1; i <= numwindows; i++)
{
window = mywindows;
window.Visible = false;
}
//drawingControl1.Window.Application.DoCmd(1669);

drawingControl1.Window.ZoomBehavior =
Visio.VisZoomBehavior.visZoomVisioExact;

drawingControl1.Window.Windows.get_ItemFromID((int)Visio.VisWinTypes.visWinIDPanZoom).Visible
= true; ;
//
myapplication.DoCmd((short)Microsoft.Office.Interop.Visio.Vis.visCmdShapesWindow);

drawingControl1.PageSizingBehavior =
Visio.VisPageSizingBehaviors.visResizePages;
//
newDocument.Application.Window.Windows.get_ItemFromID(1669).Visible =
false;


// ///////////Set the Array information////////

shapeArray = shapeinfo;
connectionArray = connectioninfo;

if (newDocument != null)
{
result = buildVisioDrawing(newDocument);
}

drawingControl1.Window.BackgroundColor =
(uint)System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);
drawingControl1.Window.BackgroundColorGradient =
(uint)System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);

}

catch (Exception ex)
{
MessageBox.Show(ex.Message);

}

return result;
}


Shail
 

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