Lost IActiveViewEvent.SelectionChanged after close form

311
5
02-21-2013 11:59 AM
Highlighted
New Contributor
Hi everyone,

I got trouble with  IActiveViewEvent.SelectionChanged  and don't know how to solve this. Maybe, this is a bug of ArcObject

I registered an event of  IActiveViewEvent.SelectionChanged. It's working ok. When user selects an objetc on ActiveView, my applicaiton will show information about that feature on a form. On the form, there is a button which will show Crystal Report document if it's clicked. If user clicks on this button, CrystaL Report is shown ok, but then IActiveViewEvent.SelectionChanged  will be lost. This event will not fired any more.

Do you know how to fix this?
Reply
0 Kudos
5 Replies
Highlighted
Regular Contributor
What kind of form are you opening?  Custom windows form?  Dockable window?  If you pass control to the form, what is going to pass control back to your active view?
Reply
0 Kudos
Highlighted
New Contributor
Hi Leo,

This is just a normal Windows Form which is shown in another dialog, not a dockable form, not a custom form.

when a feature is selected I new a form then show it

frmForm1 frm = new frmForm1();
frm.Show()

on the frmForm1, there is a button, if user click on it I will

frmForm2 frm = new  frmForm2 ();
frm.Show()

Then I close the frmForm2 then IActiveView.SelectionChanged will not fired any more.
Reply
0 Kudos
Highlighted
Regular Contributor
"SelectionChanged" is implemented on either a Map or a PageLayout.  How are you referencing your Map variable, assuming that is what you are using.  Are you using MxDocument FocusMap?
Reply
0 Kudos
Highlighted
New Contributor
As I wrote above, SelectionChanged is implemented with IActiveView.

How can you implement it with Map or PageLayout?

I'm working with Focus Map.
Reply
0 Kudos
Highlighted
Regular Contributor
I'm just asking.  Without seeing some of your code, I end up guessing.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/0012/001200000199000000.htm
Reply
0 Kudos