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:
Friend WithEvents TabControl1 As System.Windows.Forms.TabControl Friend WithEvents TabPage1 As System.Windows.Forms.TabPage 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:
Friend WithEvents TabControl1 As System.Windows.Forms.TabControl Friend TabPage1 As System.Windows.Forms.TabPage Friend TabPage2 As System.Windows.Forms.TabPage
Any thoughts?




Reply With Quote
