Can an InMemeoryFeatureLayer have more than one TestStyle? Is my method below possible? I tried adding OFFLabels1, yet only OFFLabels will display. What might I pay attention to for this to work? Thanks. I am going to hit submit even though the preview window is space delimiting my code. I hope it displays as it shows in the Format Code Block window preview and as I see it here in Create New Topic.
PrivateSubOffices_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesOffices.ClickIfOffices.Checked =FalseThenIfcommand IsNotNothingThencommand =NothingIfdataReader IsNotNothingThendataReader =NothingTryOFFconn.Open()Offices.Checked =TrueDimOfficesTagAsString=“SELECT * FROM Offices ORDER BY ID;”command =NewOleDbCommand(OfficesTag, OFFconn)dataReader = command.ExecuteReader()DimiAsIntegerIfdataReader.FieldCount > 0ThenbolOFF =TrueIfMap.Overlays.Contains(“Offices”) =FalseThenOFFLayer =NewInMemoryFeatureLayer()OFFLayer1 =NewInMemoryFeatureLayer()DimOfficesValueAsNewValueStyle()OfficesValue.ColumnName =“Name”DoWhiledataReader.Read()OfficesValue.ValueItems.Add(NewValueItem(dataReader(“Name”).ToString,NewPointStyle((NewGeoImage(Application.StartupPath +“\ATMOSIconSmall.ico”)))))Loop'create Office Designation/Name labelDimOFFLabelsAsTextStyleOFFLabels =NewTextStyle(“Name”,NewGeoFont(“Arial”, 12),NewGeoSolidBrush(GeoColor.StandardColors.Black))OFFLabels.XOffsetInPixel = 10'OFFLabels.YOffsetInPixel = 7OFFLabels.Mask =NewAreaStyle(NewGeoPen(GeoColor.StandardColors.AntiqueWhite, 1), _NewGeoSolidBrush(GeoColor.StandardColors.WhiteSmoke))'create Office Address labelDimOFFLabels1AsTextStyleOFFLabels1 =NewTextStyle(“Address”,NewGeoFont(“Arial”, 12),NewGeoSolidBrush(GeoColor.StandardColors.Black))OFFLabels1.XOffsetInPixel = 10OFFLabels1.YOffsetInPixel = 10OFFLabels1.Mask =NewAreaStyle(NewGeoPen(GeoColor.StandardColors.AntiqueWhite, 1), _NewGeoSolidBrush(GeoColor.StandardColors.WhiteSmoke))'add label layersOFFLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(OFFLabels)OFFLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(OFFLabels1)’ OFFLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.City2("[Name]" & " - " & “[Address]”))’ OFFLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.YOffsetInPixel = 50’ OFFLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlappingOFFLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(OfficesValue)OFFLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20OFFLayer.Open()OFFOverlay.Layers.Add(OFFLayer)Map.Overlays.Add(“Offices”, OFFOverlay)Fori = 0TodataReader.FieldCount - 1OFFLayer.Columns.Add(NewFeatureSourceColumn(dataReader.GetName(i)))OFFstr.Add(dataReader.GetName(i).ToString)NextiEndIfOFFLayer.EditTools.BeginTransaction()Ifcommand IsNotNothingThencommand =NothingIfdataReader IsNotNothingThendataReader =Nothingcommand =NewOleDbCommand(OfficesTag, OFFconn)dataReader = command.ExecuteReader()’ We now loop though all of the results and build up our features that we need to return.DoWhiledataReader.Read()DimOfficesFeatureAsNewFeature(CDbl(dataReader(“Longitude”)),CDbl(dataReader(“Latitude”)))Fori = 0TodataReader.FieldCount - 1OfficesFeature.ColumnValues(dataReader.GetName(i)) = dataReader(dataReader.GetName(i)).ToStringNextiOFFLayer.EditTools.Add(OfficesFeature)LoopOFFLayer.EditTools.CommitTransaction()ElseMessageBox.Show(“Offices Error!”+ Environment.NewLine +“No Records Found!”,“Data Error!”, MessageBoxButtons.OK)EndIfCatchexAsExceptionMessageBox.Show(“Offices Error!”+ Environment.NewLine + ex.Message,“Connection Error!”, MessageBoxButtons.OK)Offices.Checked =FalseFinally’ Cleanup any of the objects that need to be closed or disposed.Ifcommand IsNotNothingThencommand.Dispose()IfdataReader IsNotNothingThendataReader.Dispose()EndTryElseOffices.Checked =FalseIfMap.Overlays.Contains(“Offices”) =TrueThenMap.Overlays.Remove(Map.Overlays(“Offices”))OFFconn.Close()bolOFF =FalseEndIfMap.Refresh()IfNotbolLoadThenSaveINI()EndSub