Selection.Move() problem.

S

Stumple

Hi,

I am trying to move a selection around on the screen after it has been
pasted. The problem I am having is if it is more than about 30 drawing units
away from the original shape then an error occurs and I am unable to get a
correct Top location from .BoundingBox() so that I can move it. Everything
seems to be fine if I stay withing 30 inches or so from the copied shape. I
suspect it may have somehting to do with the location of the pasted selection
which I have always seen go into the middle of the screen.

Here is my code:

Selection s = visioCtl.Window.Selection;
double curX, curY, dummy, moveX, moveY;

//I also tried VisBoundingBoxArgs.visBBoxUprightWH as the flag here.
s.BoundingBox((short)VisTypeSelectionTypes.visTypeSelGroup, out curX, out
dummy, out dummy, out curY);

//this.mouseClickLocationX and Y are set when the mouse hits the screen so
they are the location of where I want to move to.

moveX = this.mouseClickLocationX - curX;
moveY = this.mouseClickLocationY - curY;

s.Move(moveX, moveY, VisUnitCodes.visDrawingUnits);
 

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