B
BrentW
After some days of head banging I've narrowed a question down to :
InitializeComponent();
vPage = axDrawingControl1.Window.Application.ActivePage;
rect1 = vPage.DrawRectangle(1, 1, 3, 2);
SetProperty(rect1, "NoObjHandles", "=true");
SetProperty(rect1, "LockSelect", "=1");
rect2 = vPage.DrawRectangle(3, 3, 4, 4.5);
SetProperty(rect2, "NoObjHandles", "=true");
SetProperty(rect2, "LockSelect", "=1");
moveshape = false;
axDrawingControl1.Window.DeselectAll();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void axDrawingControl1_MouseDownEvent(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseDownEvent e)
{
if (moveshape)
{
MessageBox.Show("How have we missed the MouseUp? Is it
because the SelectionChanged has swallowed it ?"
+ " Look at the Debug output to see what has happened");
Application.Exit() ;
}
moveshape = true;
Debug.Print("Mouse ***DOWN*** at x:" + e.x + " and y:" + e.y);
}
/* TRY
private void axDrawingControl1_MouseMoveEvent(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseMoveEvent e)
{
if (moveshape)
{
Debug.Print("Mouse moving at x:" + e.x + " and y:" + e.y);
}
}
* */
private void axDrawingControl1_MouseUpEvent(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseUpEvent e)
{
Debug.Print("Mouse ***UP*** at x:" + e.x + " and y:" + e.y);
moveshape = false;
}
private void axDrawingControl1_SelectionChanged(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_SelectionChangedEvent e)
{
Debug.Print("Selection changed" ) ;
}
Whether I include or exclude the MouseMove event seems not to matter the
issue is :
I can select a rectangle and move it, getting the MouseDown on the select
and the mouse up at the end of the drag.
If I try to move the other, it will move, but I am most likely to not get
the MouseUp event.
Whenever I don't get the MouseUp event, a SelectionChanged event has
happened during the drag.
Of course, this has been condensed from a very much larger application, but
if anyone feels interested enough to take my titchy VS2008 test, then I'd be
full of respect, not to mention gratitude!
InitializeComponent();
vPage = axDrawingControl1.Window.Application.ActivePage;
rect1 = vPage.DrawRectangle(1, 1, 3, 2);
SetProperty(rect1, "NoObjHandles", "=true");
SetProperty(rect1, "LockSelect", "=1");
rect2 = vPage.DrawRectangle(3, 3, 4, 4.5);
SetProperty(rect2, "NoObjHandles", "=true");
SetProperty(rect2, "LockSelect", "=1");
moveshape = false;
axDrawingControl1.Window.DeselectAll();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void axDrawingControl1_MouseDownEvent(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseDownEvent e)
{
if (moveshape)
{
MessageBox.Show("How have we missed the MouseUp? Is it
because the SelectionChanged has swallowed it ?"
+ " Look at the Debug output to see what has happened");
Application.Exit() ;
}
moveshape = true;
Debug.Print("Mouse ***DOWN*** at x:" + e.x + " and y:" + e.y);
}
/* TRY
private void axDrawingControl1_MouseMoveEvent(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseMoveEvent e)
{
if (moveshape)
{
Debug.Print("Mouse moving at x:" + e.x + " and y:" + e.y);
}
}
* */
private void axDrawingControl1_MouseUpEvent(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseUpEvent e)
{
Debug.Print("Mouse ***UP*** at x:" + e.x + " and y:" + e.y);
moveshape = false;
}
private void axDrawingControl1_SelectionChanged(object sender,
AxMicrosoft.Office.Interop.VisOcx.EVisOcx_SelectionChangedEvent e)
{
Debug.Print("Selection changed" ) ;
}
Whether I include or exclude the MouseMove event seems not to matter the
issue is :
I can select a rectangle and move it, getting the MouseDown on the select
and the mouse up at the end of the drag.
If I try to move the other, it will move, but I am most likely to not get
the MouseUp event.
Whenever I don't get the MouseUp event, a SelectionChanged event has
happened during the drag.
Of course, this has been condensed from a very much larger application, but
if anyone feels interested enough to take my titchy VS2008 test, then I'd be
full of respect, not to mention gratitude!