سؤال

I'm trying to add a shape (A simple rectangle, for that matter) pragmatically to a Visio document, using C# addin SDK, that will not cause any change to any other shape, including connectors. In other words - I want the new shape to "float" over the other shapes.

The purpose is to display some information regarding the area of the drawing. Any other solution that will allow me to do that will be more then welcomed - for example, I tried using ToolTips. However, I'm able only to rely them to shapes, while I need toconnect them to an area on the visible part of the document.

هل كانت مفيدة؟

المحلول

I was able a similar effect by locking all layers before adding my shape. For my needs, I left them locked, until the shapes were not needed anymore and I removed them, and then unlock the layers:

   foreach (Visio.Layer layer in Application.ActivePage.Layers)
   {
        layer.CellsC[(short)Visio.VisCellIndices.visLayerLock].Formula = "1";
   }

    // Add my shapes

To unlock:

   foreach (Visio.Layer layer in Application.ActivePage.Layers)
   {
       layer.CellsC[(short)Visio.VisCellIndices.visLayerLock].Formula = "0";
   }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top