How to create a fill symbol


Use this function to create a fill symbol. Fill symbols are used when rendering polygons.

How to use

  1. Call this function optionally passing in color and style. The functionreturns an ISimpleFillSymbol.
[VBA]
Private Function CreateSimpleFillSymbol(Optional pColor, _
                                        Optional pOutLine, _
                                        Optional pStyle) As ISimpleFillSymbol
    Dim pSFS As ISimpleFillSymbol
    Set pSFS = New SimpleFillSymbol
    
    If Not IsMissing(pColor) Then
        pSFS.color = pColor
    End If
    
    If Not IsMissing(pStyle) Then
        pSFS.style = pStyle
    End If
    
    If Not IsMissing(pOutLine) Then
        pSFS.Outline = pOutLine
    End If
    
    Set CreateSimpleFillSymbol = pSFS
End Function