How to Create VisioShapes on Windows Forms

  • Thread starter shailendrasingh823
  • Start date
S

shailendrasingh823

HI All,

I am trying to create VisioShapes on windows form,I got the design
control.

& add a method to drop the master shape same like
OfficeFurnitureSample but I am getting the Master shape data on
dataData Window but not any shape is visible.

private void ShowDrawing()
{

Master furnitureMaster = null;
Shape furnitureShape = null;
double dropLocationX = 0.0;
double dropLocationY = 0.0;


// Create the arrays. Arrays are needed for each new
shape's
// master and location.
//Array mastersToDrop =
Array.CreateInstance(typeof(object), numberOfShapes);
Array xyArray = Array.CreateInstance(typeof(double), (2 *
10));

// Get the master shape to drop onto the Visio drawing
page.
furnitureMaster = Utility.GetMaster(axDrawingControl1,
stencilPath, "PC");
Random randomLocation = new Random();


// The position of the drop.
xyArray.SetValue(
(int)(randomLocation.NextDouble() * 10), ( 2));
xyArray.SetValue(
(int)(randomLocation.NextDouble() * 8), (2 + 1));

Page targetPage;
targetPage = (Page)axDrawingControl1.Window.PageAsObj;
furnitureShape = targetPage.Drop(furnitureMaster,
dropLocationX, dropLocationY);

}

Thanks
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