Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to change the symbol of features and legend programmatically. When I use this code

Dim pSymbolSelector As ISymbolSelector
Set pSymbolSelector = New SymbolSelector
Dim pMarker As ISimpleMarkerSymbol
Set pMarker = New SimpleMarkerSymbol
If Not pSymbolSelector.AddSymbol(pMarker) Then
       MsgBox "Could not add symbol"
ElseIf pSymbolSelector.SelectSymbol(0) Then
       Dim pSymbol As ISymbol
       Set pSymbol = pSymbolSelector.GetSymbolAt(0)
End If

then Symbol Selector is open, but when I select a symbol it is not being applied at the current layer in Table of Contents.

share|improve this question

According to the ESRI documentation: "The SymbolSelector class is used for presenting the user with a choice of symbols: marker, line, fill, or text. The symbols in the selector are taken from the currently referenced style files."

If you want to handle this task programmatically, without user input, you can use IFeatureRenderer.

share|improve this answer
Thanks a lot for ur response...But when i run the above code it open Symbol selector of only single type it does not change it for polyline or polygon type featureclass.. it means it shows only point type symbols not for polyline and polygon type.what should i do for that.. – Manish Sharma Aug 29 '12 at 5:04
You're using 'ISimpleMarkerSymbol', which will give you a point marker. The code you posted is for point symbols, not line/polygon. IFeatureRenderer is still your best bet. – Radar Aug 31 '12 at 16:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.