Implementing a property page for an ArcGIS Engine application
PropertySheet.vb
' Copyright 2012 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See the use restrictions.
' 

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Data
Imports System.Text
Imports System.Windows.Forms
Imports System.Runtime.Remoting
Imports System.Runtime.InteropServices

Imports ESRI.ArcGIS.Carto

Namespace SymbolSelector
  'delegate for the OnFeatureLayerRendererChanged event
  Public Delegate Sub FeatureLayerRendererChanged(ByVal sender As Object, ByVal args As EventArgs)

  ''' <summary>
  ''' PropertySheet class which serves as the manager for the PropertyPages
  ''' </summary>
  <Guid("1065420E-E725-4109-A038-66201784DFB9"), ComVisible(True), ProgId("SymbolSelector.PropertySheet"), ClassInterface(ClassInterfaceType.None)> _
  Public Partial Class PropertySheet : Inherits UserControl : Implements IProvideObjectHandle, ISpecifyPropertyPages

  Private m_featureLayer As IFeatureLayer

  'an event which gets fired when the page has applied change to the layer's renderer
  Public Event OnFeatureLayerRendererChanged As FeatureLayerRendererChanged

  #Region "Constructor"
  Public Sub New()
    InitializeComponent()
  End Sub
  #End Region

  #Region "IProvideObjectHandle Members"

  ''' <summary>
  ''' Wraps marshal-by-value object references, allowing them to be returned through an indirection.
  ''' </summary>
  Public ReadOnly Property ObjectHandle() As System.Runtime.Remoting.ObjectHandle Implements IProvideObjectHandle.ObjectHandle
    Get
      Return New ObjectHandle(Me)
    End Get
  End Property

  #End Region

  #Region "ISpecifyPropertyPages Members"

  ''' <summary>
  ''' ills an array of CLSIDs for each property page that can be displayed in this object's property sheet.
  ''' </summary>
  ''' <param name="pPages">Pointer to a caller-allocated CAUUID structure that must be initialized and filled before returning.</param>
  Public Sub GetPages(ByRef pPages As CAUUID) Implements ISpecifyPropertyPages.GetPages
    Dim g As Guid() = New Guid(0){}

    g(0) = GetType(SymbolSelectorPropPage).GUID
    pPages.SetPages(g)
  End Sub

  #End Region

  ''' <summary>
  ''' the FeatureLayer which connects the PropertySheet to the actual layer
  ''' </summary>
  Public Property FeatureLayer() As IFeatureLayer
    Get
      Return m_featureLayer
    End Get
    Set
      m_featureLayer = Value
    End Set
  End Property

  ''' <summary>
        ''' Fires an event to notify the listener that the layer's renderer has been changed
  ''' </summary>
  Public Sub FireFeatureLayerRendererChanged()
    If Not Nothing Is OnFeatureLayerRendererChangedEvent Then
    RaiseEvent OnFeatureLayerRendererChanged(Me, New EventArgs())
    End If
  End Sub
  End Class
End Namespace