L
LarryF
I'm sure I'm missing something obvious, but I'm stumped.
Window.SelectAll() works fine for me, but Window.DeselectAll() seems to
do nothing at all.
I'm running a Visio 2003 SP2 DrawingControl in a C# form. My test
program has three buttons, one each for drawing, selecting, and
deselecting. Here's a code snippet:
private AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl dc;
private void btnDraw_Click(object sender, System.EventArgs e) {
dc.Document.Pages[1].DrawRectangle(3, 3, 5, 5);
dc.Document.Pages[1].DrawRectangle(4, 4, 6, 6);
}
private void btnSelect_Click(object sender, System.EventArgs e) {
dc.Window.SelectAll();
}
private void btnDeselect_Click(object sender, System.EventArgs e) {
dc.Window.DeselectAll();
}
'dc' is the drawing control, which I added by dragging 'Microsoft Visio
11.0 Drawing Control' from the toolbox onto a form. When you click
btnDraw, it draws two rectangles. When you click btnSelect, it selects
them both. When you click btnDeselect, it executes the
dc.Window.DeselectAll(), but the two shapes are still selected.
In a NoEventsPending event handler in my full application, I can make a
call to DeselectAll () throw a 'Requested operation is presently
disabled' exception, and a call to Select() can throw 'Invalid window
type for this action' exception, after drawing, grouping, and deleting
several shapes. So I wrote the simple test app.
Can one of you mavens please point out glaringly obvious reason that
DeselectAll() won't work for me?
Thanks
Window.SelectAll() works fine for me, but Window.DeselectAll() seems to
do nothing at all.
I'm running a Visio 2003 SP2 DrawingControl in a C# form. My test
program has three buttons, one each for drawing, selecting, and
deselecting. Here's a code snippet:
private AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl dc;
private void btnDraw_Click(object sender, System.EventArgs e) {
dc.Document.Pages[1].DrawRectangle(3, 3, 5, 5);
dc.Document.Pages[1].DrawRectangle(4, 4, 6, 6);
}
private void btnSelect_Click(object sender, System.EventArgs e) {
dc.Window.SelectAll();
}
private void btnDeselect_Click(object sender, System.EventArgs e) {
dc.Window.DeselectAll();
}
'dc' is the drawing control, which I added by dragging 'Microsoft Visio
11.0 Drawing Control' from the toolbox onto a form. When you click
btnDraw, it draws two rectangles. When you click btnSelect, it selects
them both. When you click btnDeselect, it executes the
dc.Window.DeselectAll(), but the two shapes are still selected.
In a NoEventsPending event handler in my full application, I can make a
call to DeselectAll () throw a 'Requested operation is presently
disabled' exception, and a call to Select() can throw 'Invalid window
type for this action' exception, after drawing, grouping, and deleting
several shapes. So I wrote the simple test app.
Can one of you mavens please point out glaringly obvious reason that
DeselectAll() won't work for me?
Thanks