This project is read-only.

Show attribute table

Jun 14 at 10:39 AM
Hello! My English is poor.
I'm developing my application in C # with MapWinGis and I had a question.

This code gives the number of selected objects on the map ....
How do I get the attribute table of selected objects on the map?
Thank You.
 private void axMap1_SelectBoxFinal(object sender, _DMapEvents_SelectBoxFinalEvent e)
        {
            int layerHandle = axMap1.get_LayerHandle(3);
            Shapefile sf = axMap1.get_Shapefile(layerHandle);
            if (sf != null)
            {
                double left = 0.0;
                double top = 0.0;
                double bottom = 0.0;
                double right = 0.0;
                axMap1.PixelToProj(e.left, e.top, ref left, ref top);
                axMap1.PixelToProj(e.right, e.bottom, ref right, ref bottom);

                object result = null;
                var ext = new Extents();
                ext.SetBounds(left, bottom, 0.0, right, top, 0.0);
                string s = "";
                sf.SelectNone();
                if (sf.SelectShapes(ext, 0.0, SelectMode.INTERSECTION, ref result))
                {

                    int[] shapes = result as int[];
                    if (shapes == null) return;
                    for (int i = 0; i < shapes.Length; i++)
                    {
                        sf.set_ShapeSelected(shapes[i], true);   
                    }
                }
                axMap1.Redraw();
                MessageBox.Show(s);
                 RefreshMap();
            }
        }