I can add labels with this code to my overlay but cannot remove them. A simple menu item toggle on and off is all this is.
I may be oversimplifying this.
Designations.Checked = plRegionN.ZoomLevelSet.ZoomLevel15.CustomStyles.Add(plRegionNTextStyle) plRegionN.ZoomLevelSet.ZoomLevel15.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 plRegionNTextStyle.TextLineSegmentRatio = 50 plRegionSE.ZoomLevelSet.ZoomLevel15.CustomStyles.Add(plRegionSETextStyle) plRegionSE.ZoomLevelSet.ZoomLevel15.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 plRegionSETextStyle.TextLineSegmentRatio = 50 plRegionSWTextStyle.YOffsetInPixel = 10 plRegionSW.ZoomLevelSet.ZoomLevel15.CustomStyles.Add(plRegionSWTextStyle) plRegionSW.ZoomLevelSet.ZoomLevel15.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 plRegionSWTextStyle.TextLineSegmentRatio = 50 Designations.Checked = plRegionSE.ZoomLevelSet.ZoomLevel01.CustomStyles.Remove(plRegionSETextStyle) plRegionSW.ZoomLevelSet.ZoomLevel01.CustomStyles.Remove(plRegionSWTextStyle) Map.Refresh() Private Sub Designations_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Designations.ClickDim plRegionNTextStyle As New TextStyle("Designation", New GeoFont("Arial", 12, DrawingFontStyles.Italic), New GeoSolidBrush(GeoColor.StandardColors.Black))Dim plRegionSETextStyle As New TextStyle("Designation", New GeoFont("Arial", 12, DrawingFontStyles.Italic), New GeoSolidBrush(GeoColor.StandardColors.Black))Dim plRegionSWTextStyle As New TextStyle("Designation", New GeoFont("Arial", 12, DrawingFontStyles.Italic), New GeoSolidBrush(GeoColor.StandardColors.Black))If Designations.Checked = False Then
True
plRegionNTextStyle.YOffsetInPixel = 10plRegionSETextStyle.YOffsetInPixel = 10'plRegionNTextStyle.Name = "plRegionSWTS"
Else
False
plRegionN.ZoomLevelSet.ZoomLevel01.CustomStyles.Remove(plRegionNTextStyle)End If
End Sub