//#region 使用自定义风格设置选中状态 Selection selection = new Selection();//从该记录集获取选择集 selection.FromRecordset(recordsetTemp); selection.SetStyleOptions(StyleOptions.FillBackColor, true); selection.SetStyleOptions(StyleOptions.FillBackOpaque, true); selection.SetStyleOptions(StyleOptions.FillForeColor, true); selection.SetStyleOptions(StyleOptions.FillGradientAngle, true); selection.SetStyleOptions(StyleOptions.FillGradientMode, true); selection.SetStyleOptions(StyleOptions.FillGradientOffsetRatioX, true); selection.SetStyleOptions(StyleOptions.FillGradientOffsetRatioY, true); selection.SetStyleOptions(StyleOptions.FillOpaqueRate, true); selection.SetStyleOptions(StyleOptions.FillSymbolID, true); selection.SetStyleOptions(StyleOptions.LineColor, true); selection.SetStyleOptions(StyleOptions.LineSymbolID, true); selection.SetStyleOptions(StyleOptions.LineWidth, true); selection.SetStyleOptions(StyleOptions.MarkerAngle, true); selection.SetStyleOptions(StyleOptions.MarkerSize, true); selection.SetStyleOptions(StyleOptions.MarkerSymbolID, true); selection.IsDefaultStyleEnabled = false;//设置不使用默认选择风格 GeoStyle geoStyle = selection.Style;//设置选择集的风格 geoStyle.FillForeColor = Color.Blue; geoStyle.FillBackOpaque = false; geoStyle.FillBackColor = Color.Blue; geoStyle.FillSymbolID = 0; geoStyle.FillOpaqueRate = 0; geoStyle.LineColor = Color.Blue; geoStyle.LineWidth = 1.0; selection.Style = geoStyle; layer.Selection = selection; #endregion