filter labels

Nov 20, 2014 at 7:45 AM
Hi,

Is it possible to display only some labels according to another field ? Something like
[TYPE] WHERE [STATUS]="OK"

which would displays as a label the content of [TYPE] if the field [STATUS] contains "OK"

Thanks,

Olivier
Nov 20, 2014 at 10:04 AM
Ok, I answer myself...
With .Labels
                             .Generate("[TYPE]", MapWinGIS.tkLabelPositioning.lpMiddleSegment, False) 
                            Dim ct As MapWinGIS.LabelCategory
                            ct = .AddCategory("OFF")
                            ct.Expression = "[STATUS] = " & quote & "NOK" & quote
                            ct.Visible = False
                            ct = .AddCategory("ON")
                            ct.Expression = "[STATUS] <> " & quote & "OK" & quote
                            ct.FontSize = 10
                            ct.Visible = True
                            .ApplyCategories()
End With
Marked as answer by pmeems on 11/20/2014 at 11:23 PM
Coordinator
Nov 21, 2014 at 6:23 AM
Thanks for sharing your answer.