none
TabControls/TabPages wierd problem when hosting Form Designer RRS feed

  • Question

  • I'm writing a form designer in C#, and I'm trying to modify the VS-style behavior for adding tabpages to a tab control.  I want the user to be able to add a TabControl, and then to add Tabs just add them to the TabControl like a normal control.

    However, when I add a TabPage to a TabControl on the form, I get the following error message:

    Cannot add 'TabPage' to tabcontrol. Only Tabpages can be added directly to tabcontrols.

    This happens before execution hits my code (I have a breakpoint right at the start of the method attatched to the IComponentChangeService.ComponentAdding event, which is not triggered).

    Has anyone else come across this before?

    I am using the IToolboxService service to provide the ToolboxItems.
    Thanks
    Friday, February 9, 2007 12:32 AM