Set Symbology....

Discussion created by jaykappy on Apr 9, 2010
Latest reply on Apr 16, 2010 by jaykappy
I am opening a layer with the code below.  But I have a field that I want to set the symbology to.

After the Shapefile is added to the project, how do I change the symbology?

Class = 1 set to red
Class = 2 set to blue

Sub AddXYShapefileCreatedTable_Click(FileName As String)

Dim pMxDocument As IMxDocument
Dim pMap As IMap
Dim pworkspaceFactory As IWorkspaceFactory
Dim pfeatureWorkspace As IFeatureWorkspace
Dim pFeatureLayer As IFeatureLayer

'Create a new ShapefileWorkspaceFactory object and open a shapefile folder
    Set pworkspaceFactory = New ShapefileWorkspaceFactory
    Set pfeatureWorkspace = pworkspaceFactory.OpenFromFile("C:\Temp", 0)
'Create a new FeatureLayer and assign a shapefile to it
    Set pFeatureLayer = New FeatureLayer
    Set pFeatureLayer.FeatureClass = pfeatureWorkspace.OpenFeatureClass(FileName)
    pFeatureLayer.Name = pFeatureLayer.FeatureClass.AliasName
    'Add the FeatureLayer to the focus map
    Set pMxDocument = Application.Document
    Set pMap = pMxDocument.FocusMap
    pMap.AddLayer pFeatureLayer

End Sub