Identity Tool using mapwingis and C#

Dec 19, 2013 at 4:51 PM
I am trying to develop a desktop gis application.. pls help me to code for the identity button...so i can access the feature of any polygon in a new form or DataGridView...
Thanks in advance...
dgambhir143@gmail.com
Dec 23, 2013 at 10:40 AM
Search for Axmap.CursorMode = MapWinGIS.tkCursorMode.cmSelection

This VB code use mousedownevent to point to a feature and set attributes in a textbox

If AxMap1.CursorMode = MapWinGIS.tkCursorMode.cmSelection Then
buffer = 5 'For points and lines give a 5 pixel buffer for selecting the shapes
            With AxMap1
            .PixelToProj(e.x - buffer, e.y + buffer, TL.x, TL.y)
            .PixelToProj(e.x + buffer, e.y - buffer, BR.x, BR.y)
            ext.SetBounds(TL.x, BR.y, 0, BR.x, TL.y, 0)
                '---------------------------
                ' search shapefile
                '---------------------------
                If .get_Shapefile(hchapt).SelectShapes(ext, 0.0, MapWinGIS.SelectMode.INTERSECTION, shapes) Then ' select object
                    shpf = .get_Shapefile(hchapt)
                    shpf.SelectNone() ' suppression des shapes précédemment saisies
                    shap = shpf.Shape(0)
                    shpf.ShapeSelected(shapes(0)) = True
                    Tb.Text = shpf.CellValue(fcode_ch1, shapes(0))
                    TbX.Text = shap.Point(0).x.ToString
                    TbY.Text = shap.Point(0).y.ToString
                    AxMap1.Redraw()