HourGlass pointer after adding an object from the stencil

P

Paul

Hi,
I'm designing an application that uses Visio SDK and I have come across a
problem I'm not able to fix or understand why it's happening.

I have a ShapeAdded hanldler which pops up a properties window (form) upon
dragging and dropping an object from the stencil. After closing the
properties form the pointer turns to an hourglass every once in a while. This
behavior only happens when I display the form modally.

Does this happen because the shape is still being created?

I definitely need to display the form modally so if anyone could offer any
tips it would be great.

Thanks
 
P

Paul

Here are the events that fire:

With the modal for:

12048 >EnterScope Drop On Page [1246;0;Drop On Page;4392670]
12049 | ShapeAdded Entity 2.13 [/doc=1 /page=1 /shape=Sheet.13
/shapeu=Sheet.13]
---------------- Stops when ShapeAdded fires -------------------------
12049 | SelectionAdded Entity 2.13 [/doc=1 /page=1]
12050 | SelectionChanged window[1] VisioDocument Page-1 subtype is 128
[/hwnd=4392670]
12051 <ExitScope Drop On Page [1246;0;Drop On Page;4392670]
12052 >EnterScope Shape Data [1479;0;Shape Data;4392670]
12053 <ExitScope Shape Data [1479;1;Shape Data;4392670]



Without the form

14583 >EnterScope Drop On Page [1246;0;Drop On Page;4392670]
14584 | ShapeAdded Entity 2.19 [/doc=1 /page=1 /shape=Sheet.19
/shapeu=Sheet.19]
14584 | SelectionAdded Entity 2.19 [/doc=1 /page=1]
14585 | SelectionChanged window[1] VisioDocument Page-1 subtype is 128
[/hwnd=4392670]
14586 <ExitScope Drop On Page [1246;0;Drop On Page;4392670]
14587 >EnterScope Shape Data [1479;0;Shape Data;4392670]
14588 <ExitScope Shape Data [1479;1;Shape Data;4392670]

So that interruption appears to cause the problem. Does anyone have any idea
why that is?

Thanks
 
P

Paul Herber

Hi,
I'm designing an application that uses Visio SDK and I have come across a
problem I'm not able to fix or understand why it's happening.

I have a ShapeAdded hanldler which pops up a properties window (form) upon
dragging and dropping an object from the stencil. After closing the
properties form the pointer turns to an hourglass every once in a while. This
behavior only happens when I display the form modally.

Does this happen because the shape is still being created?

I definitely need to display the form modally so if anyone could offer any
tips it would be great.

Would you like to post your code?
Does the form have an ok/cancel button? Do you have an event handler
for clicking a button which then closes the form?
 
P

Paul

Hi Paul,
thanks for trying to help.

In the parent form I have:
this.axDrawingControl1.ShapeAdded += new
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_ShapeAddedEventHandler(axDrawingControl1_ShapeAdded);

CObjectProperties newCObject = new CObjectProperties();
if (newCObject.ShowDialog() == DialogResult.OK)
newCObject.Dispose();
else
e.shape.Delete();

I managed to get rid of the hour glass by deselecting all the shapes and
then reselecting the one that was just added, however I'm most likely doing
something wrong since this isn't required with a non modal form.

this.axDrawingControl1.Window.DeselectAll();
this.axDrawingControl1.Window.Select(e.shape, 2);


Thanks again,
Paul
 

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