So I have a custom control that when added to a form will create two child controls inside it. The custom control's designer handles the creation of these. The problem I am having is that when the designer generates code for these controls only the parent control is declared "WithEvents". So my question is: how do I get my designer to create a component that will be declared WithEvents?

Here is an example, if you add a standard TabControl onto your form and take a look at the designer code you will see them declared like this:

vb.net Code:
  1. Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
  2. Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
  3. Friend WithEvents TabPage2 As System.Windows.Forms.TabPage

The problem I am basically having is that the TabPages would be declared without "WithEvents":

vb.net Code:
  1. Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
  2. Friend TabPage1 As System.Windows.Forms.TabPage
  3. Friend TabPage2 As System.Windows.Forms.TabPage

Any thoughts?