More than 1 label

Aug 22, 2012 at 11:54 AM
Edited Aug 22, 2012 at 11:58 AM


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

i am using,my code is as below.

Dim shp As New MapWinGIS.Shapefile
        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)

    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 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.