Hi all,
playing around with AreaStyles I cann't change style of polygons stored in a FeatureLayer.
Changing the predefined areastyle will draw all polygons invisible, the geometry can be selected. The items are still on the layer but invisible.
Does anyone knows how to set the AreaStyle in a correct way?
Please have a look at my code:
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
Try
Dim MyStyle As AreaStyle
If Hatch.Text = "Cross" Then
MyStyle = AreaStyles.CreateHatchStyle(GeoHatchStyle.Cross, GeoColor.FromArgb(0, 0, 0, 0), GeoColor.FromArgb(0, 200, 100, 0), GetGeoColor("0,0,0,0"), 1, LineDashStyle.Solid, 0, 0)
Else
MyStyle = AreaStyles.CreateHatchStyle(GeoHatchStyle.Percent30, GeoColor.FromArgb(0, 255, 0, 0), GeoColor.FromArgb(0, 0, 100, 255), GetGeoColor("0,0,0,0"), 1, LineDashStyle.Solid, 0, 0)
End If
Dim layer As FeatureLayer = GetLayer("gm_fhm_grab_geo")
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = MyStyle
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Map.Refresh()
Catch ex As Exception
End Try
End Sub