1
我有一個簡單的代碼來繪製形狀。如何通過C#在Visio 2010中添加容器?
Visio.Shape dropShape = ActivePage.Drop(GetMaster(@"Circle"), x, y);
Visio.Shape dropShape2 = ActivePage.Drop(GetMaster(@"Circle"), x + 3, y);
我whant添加容器形狀這
VisApp.ActiveWindow.Select(dropShape, (short)Visio.VisSelectArgs.visSelect);
VisApp.ActiveWindow.Select(dropShape2, (short)Visio.VisSelectArgs.visSelect);
object vsoSelection = VisApp.ActiveWindow.Selection;
Visio.Shape containerMaster = ActivePage.Drop(GetMaster(@"Square"), x -3, y-3);
Visio.Shape container = ActivePage.DropContainer(containerMaster, vsoSelection);
我在網上查到了這個樣本,但沒有奏效。有什麼想法?