Hi all!
I'm trying to implement my custom designer.
Custom designer is loaded inside Visual Studio 2008 like a toolwindow using VSPackage.
My design surface is successfully created and i can set controls inside it.
This is the problem: I have a TabControl that could have many TabPages and inside of each of the many other controls (also custom controls).
No problem when i load controls on the first TabPage (or in a TabControl with only one TabPage).
I've got problems when TabControl has many TabPages, for example 2, and when i try to select one of them. The first one is successfully running with design-time behaviours of controls, but selecting other TabPagesVisual Studio crashes.
Is it a bug?
Am i doing something wrong?
Here some code.
Here i create a new TabPage:
TabPage ctrTabPage= new TabPage(nameCaption);
Here i add it to the TabControl:
ctrTabControl.TabPages.Add(ctrTabPage);
Here i create a new control (is a custom control):
controlToAdd= (Control)mDesignSurface.CreateControl(controlType);
Here i add the control to the correct tabpage:
ctrTabPage.Controls.Add(controlToAdd);<br/>
I can't understand the problem. All works only for the first tabpage, crash selecting others.
Has anyone an idea?
Thanks!
- Matteo Garzulino -