Hello,
Can anybody tell me how to set the selected feature border colour only using Arcobject C#?
My C# Coding:
IMap map = axMapControl1.Map;
IFeatureSelection featSel;
IFeatureLayer fLayer;
fLayer = axMapControl1.get_Layer(0) as IFeatureLayer;
featSel = fLayer as IFeatureSelection;
IQueryFilter qFilt = new QueryFilter();
string crops = txtCrop.Text;
qFilt.WhereClause = "Crop LIKE '%" + crops + "' OR Crop LIKE '" + crops + "%' OR Crop LIKE '%" + crops + "%'";
featSel.Clear();
featSel.SelectFeatures(qFilt, esriSelectionResultEnum.esriSelectionResultNew, false);
MessageBox.Show(featSel.SelectionSet.Count.ToString() + " features selected");
IRgbColor grn = new RgbColor();
grn.Red = 50;
grn.Green = 255;
grn.Blue = 255;
featSel.SelectionColor = grn;
axMapControl1.Refresh();
Regards,
Raj
You can define a custom symbol yourself and then use it as selection symbol, using ILayerDescription.SelectionSymbol Property. "Use this property when you want something other than the default symbology to indicate selected features. For example, you want to use a star symbol to indicate selected point features.SelectionSymbol is only applied if SetSelectionSymbol is set to TRUE. Otherwise, default symbols are used."
There is also a little example code snippet at http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000715000000