Use the IIdentifyDialog provided by AE to create the class identifyTool. Then, you can click the button in the program to simulate the Identify function in the ArcMap tool.
Class Generation Code:
1 public sealed class identifyTool: BaseTool
2 {
3 IHookHelper pHookHelper = new HookHelperClass ();
4 public identifyTool ()
5 {
6 m_cursor = new System. Windows. Forms. Cursor (@ "... \ .. \ Resources \ Identify_md.cur ");
7
8}
9
10 public override void OnCreate (object hook)
11 {
12 pHookHelper. Hook = hook;
13}
14 public override void OnMouseDown (int Button, int Shift, int X, int Y)
15 {
16
17 IActiveView pActiveView;
18 IIdentifyDialog pIdentifyDialog;
19 IIdentifyDialogProps pIdentifyDialogProps;
20 IEnumLayer pEnumLayer;
21 ILayer pLayer;
22
23 pActiveView = pHookHelper. ActiveView;
24
25 pIdentifyDialog = new IdentifyDialogClass ();
26 pIdentifyDialogProps = pIdentifyDialog as IIdentifyDialogProps;
27 pIdentifyDialog. Map = pHookHelper. ActiveView. FocusMap;
28 pIdentifyDialog. Display = pActiveView. ScreenDisplay;
29
30 pIdentifyDialog. ClearLayers ();
31
32 pEnumLayer = pIdentifyDialogProps. Layers;
33 pEnumLayer. Reset ();
34 pLayer = pEnumLayer. Next ();
35 while (pLayer! = Null)
36 {
37 pIdentifyDialog. AddLayerIdentifyPoint (pLayer, X, Y );
38 pLayer = pEnumLayer. Next ();
39}
40 pIdentifyDialog. Show ();
41}
42}
M_cursor is used to set the mouse style.
The Map and Display attributes of IIdentifyDialog must be set.
(Refer to ESRI China Community)