Adding multi-line labels in vb.net


#1

I know I’m missing something simple, but I am having trouble adding multi-line labels.

It seems like this should work, but it doesn’t. It just puts the text ‘\n’ in between the two fields.

sf.Labels.Generate(""“Prec:”" + [precinct] + “”/n"" + ““Pop:”” + [voter_pop]", MapWinGIS.tkLabelPositioning.lpCenter, False)

Anyone know how to do this?


#2

Sorry - just noticed I have /n in the example. I have tried it both ways, /n and \n without success.


#3

Try Environment.NewLine


#4

Thanks, Paul, that worked. I did it like this:

Dim ex As String = """Prec:""  + [precinct] + """ & Environment.NewLine & """ + "" Pop:"" + [voter_pop]"
MapWinGIS.tkLabelPositioning.lpCenter, False)
sf.Labels.Generate(ex, MapWinGIS.tkLabelPositioning.lpCenter, False)

closed #5