More than 1 label

Aug 22, 2012 at 12:54 PM
Edited Aug 22, 2012 at 12:58 PM

Hi,

i am new to mapwindow,i wanna know how to display more than 1 label if i have a shapefile

i am using vb.net,my code is as below.

Dim shp As New MapWinGIS.Shapefile
        shp.Open("C:\VillageProfile\DistrictBoundry.shp")
        g_MapWin.Layers.Add(shp, "District")
        g_MapWin.Layers(g_MapWin.Layers.CurrentLayer).OutlineColor = Drawing.Color.Black
        g_MapWin.Layers(g_MapWin.Layers.CurrentLayer).Color = Drawing.Color.Transparent

        Dim worldSF As New MapWinGIS.Shapefile
        Dim sf As New MapWinGIS.Shapefile
        For a As Integer = 0 To worldSF.NumShapes
            Dim layerno As Integer
            layerno = g_MapWin.Layers.CurrentLayer
            Dim text As String
            Dim x As Double, y As Double
            sf = g_MapWin.Layers(layerno).GetObject()
            x = 0
            y = 0
            text = sf.CellValue(0, a)
            x = ((sf.Shape(a).Extents.xMax + sf.Shape(a).Extents.xMin) / 2)
            y = ((sf.Shape(a).Extents.yMax + sf.Shape(a).Extents.yMin) / 2)
            g_MapWin.Layers(layerno).AddLabel(text, Drawing.Color.Black, x, y, tkHJustification.hjCenter)
        Next

    End Sub

now i wanna add 26 labels to different layers.Now i have a database and i want to loop it,so that when the program initializes it shows the labels in ma shapefile.my sf.cellvalue(0,a) gets the name from the database and stores it in text,i want to increment some variable into the database using loop.

please help.