Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: Adding Labels in Vba in 4.9.3

$
0
0
Hello everybody,

I'm still working on Labels in MapWinGis.Ocx 4.9.3
I use the following code to add Labels - but nothing seems to happen (even the extents aren't changed) though the code did not produce an error:
Private Sub cmdAddLayers_Click()
    Dim objText As MapWinGIS.Shapefile
    Dim i As Integer
    Dim strLabel As String
    Dim dblX As Double, dblY As Double
   
    Set objText = New MapWinGIS.Shapefile
    If objText.Open(Application.CurrentProject.Path & "\texte.shp") = True Then
        objText.Labels.FontName = "Arial"
        objText.Labels.FontSize = 12
        ' Shape-Objekt durchlaufen
        For i = 0 To objText.NumShapes - 1
            ' Label-Text ermitteln
            strLabel = objText.CellValue(6, i)
            ' Label-Koordinaten ermitteln
            dblX = objText.Shape(i).Point(0).x
            dblY = objText.Shape(i).Point(0).y
            objText.Labels.AddLabel strLabel, dblX, dblY
        Next i
    End If
End Sub
If I add an "ordinary" shapelayer instead everything works fine. I can't see whats wrong.

Can anybody help?

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>