Public Class UserControl1

    'Notice I'm Inherting the Button....

    Inherits System.Windows.Forms.Button

 

    Private Sub UserControl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        'Call the exposed Event of the Control...

        RaiseEvent YouClickedTheButton()

    End Sub

    '*********************************************************************************************

    'This Event will appear as one of the control's properties on the Designer Form.             *

    'For example:                                                                                *

    '                                                                                            *   

    '  Private Sub UserControl11_YouClickedTheButton() Handles UserControl11.YouClickedTheButton *

    '    MessageBox.Show("Howdy!")                                                               *  

    '  End Sub                                                                                   *

    '                                                                                            *

    Public Event YouClickedTheButton() 'Create an exposed Event for the control.                 *

    '                                                                                            *

    '*********************************************************************************************

 

 

    'Here is a sample Property....

    Dim BColor As Color

    Public Property ButtonColor() As Color

        Get

            Return BColor

        End Get

        Set(ByVal Value As Color)

            BColor = Value

            Me.BackColor = BColor

        End Set

    End Property

 

 

End Class