Lines drawn with old Default Line Style

G

Guy..L

A mouse click event is captured using a hook placed into the code shown in
the SDK's EventSink example. During the hook routine, a the
Page.Document.DefaultLinestyle is changed to a style that draws a fat red
line instead of the normal black line. The red line is drawn over the top of
an existing black line up to the vertex closest to the mouse click. At the
end of the hook routine, the DefaultLinestyle is set back to "Normal".

The behaviour is such that the original black line is redrawn in red after
the hook is done. Why is the existing shape being rendered in red without a
specific call from my code?

I have added a test drawing line (mousex, mousey) to (mousex+1, mousey+1)
inside the mouse hook. Sure enough, the most recent mouse click produces a
thin black line; however, on the next mouse click somewhere else, that second
most recent mouse click test line is redrawn in fat red.

Why are existing shapes being redrawn in fat red, after I've explicitly set
the DefaultLinestyle back to "Normal"?
 
G

Guy..L

This is a Winforms C# application hosting the AxDrawingControl.

If I put a MessageBox.Show("Yo") after the fat red line drawing code inside
the hook, older shapes are not re-rendered.

Is there something I'm missing that the Control needs to call
Application.DoEvents() to prevent the control rendering already drawn shapes??
 
G

Guy..L

I don't know why; but a call to Application.DoEvents() before changing the
DefaultLinestyle appears to fix and prevent the redrawing problem.
 

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