Re: Trouble with DeselectAll()
- From: LarryF@xxxxxxxxxxxx
- Date: 12 Jul 2006 16:07:21 -0700
JuneTheSecond wrote:
How about DoCmd?
dc.Window.Application.DoCmd(1213);
DoCmd(1213) behaves exactly like calling DeselectAll(), meaning that it
doesn nothing at all in my event handler.
I've found that calling DeselectAll() twice in a row does work, meaning
that the first call does nothing but the second call does what it is
supposed to. Calling DoCmd(1213) twice also works. This is not a good
work-around for me because the real problem involves exceptions being
thrown is certain cases.
So I reinstalled Visual Studio 2003 and Visio 2003. Same problem. Then
I got a different computer with a clean install of Windows XP and
installed VS 2003 and Visio 2003. Same problem.
I think my problem is related to event handling. Calling DeselectAll
from an event handler seems to be what is broken. Calling it twice in
the same event handler works, but calling it once each in two
subsequent event handlers fails. Using Selection.DeselectAll() works
wrong just like Window.DeselectAll().
Why doesn't this work for me:
- Create a new Visual Studio C# project.
- Add a drawing control and two buttons named Draw and Deselect.
- In the event handler for the Draw button, put:
dc.Document.Pages[1].DrawRectangle(2, 2, 4, 4);
- In the event handler for the Deselect button, put:
dc.Document.Application.Window.DeselectAll();
Run the project and click the Draw button. It draws a square and
selects it so you see the eight green resize handles around it. Click
the Deselect button. The shape is still selected. Why is it still
selected?
Thanks for any help you can give me.
.
- Follow-Ups:
- Re: Trouble with DeselectAll()
- From: Paul Herber
- Re: Trouble with DeselectAll()
- References:
- Trouble with DeselectAll()
- From: LarryF
- Re: Trouble with DeselectAll()
- From: LarryF
- Trouble with DeselectAll()
- Prev by Date: Re: Printing pages in VISIO, where the first page is not 1
- Next by Date: Re: Trouble with DeselectAll()
- Previous by thread: Re: Trouble with DeselectAll()
- Next by thread: Re: Trouble with DeselectAll()
- Index(es):
Relevant Pages
|