Hi Newsgroup
I finally found the answer on:
http://www.developerfusion.co.uk/show/4665/6/
I simply had added a new tabpage to the control, but I should have used the
CreateComponent method of IDesignerHost:
Dim h As IDesignerHost =
DirectCast(GetService(GetType(IDesignerHost)), IDesignerHost)
Dim dt As DesignerTransaction = Nothing
Dim c As IComponentChangeService =
DirectCast(GetService(GetType(IComponentChangeService)),
IComponentChangeService)
'Add a new tabpage to the collection
Dim t As TabPage = Nothing
dt = h.CreateTransaction("Add Step")
t = DirectCast(h.CreateComponent(GetType(TabPage)), TabPage)
t.Text = Replace(Me.jkw.strText_StepTitle, "%nr%",
Me.jkw.tabPages.TabCount)
c.OnComponentChanging(Me.jkw, Nothing)
Me.jkw.tabPages.TabPages.Add(t)
c.OnComponentChanged(Me.jkw, Nothing, Nothing, Nothing)
Me.jkw.tabPages.SelectedIndex = Me.jkw.tabPages.TabCount - 1
dt.Commit()
Thank you for your help Brian.
Greetings Johnny
[quoted text, click to view] "Johnny Kühne" wrote:
> Hi Bryan
>
> Thank you for your answer.
> Yes, I tested with "content" and "visible" for the control.
>
> Greetings
>
> "Bryan Phillips" wrote:
>
> > Have you looked at applying the DesignerSerialization attribute to the
> > property for the tab collection?
> >
> > --
> > Bryan Phillips
> > MCT, MCSD, MCDBA, MCSE
> > Blog:
http://bphillips76.spaces.live.com > > Web Site:
http://www.composablesystems.net > >
> >
> >
> > "Johnny Kühne" <JohnnyKhne@discussions.microsoft.com> wrote in message
> > news:DCFB1211-A3DB-4F06-9157-1BD3575A722D@microsoft.com:
> >
> > > Hello Newsgroup
> > >
> > > I'm working with VS 2005 Prof. on a usercontrol, which should look like a
> > > wizzard.
> > >
> > > In this usercontrol I have tabcontrol, which should be active in designtime,
> > > so a user can drag other controls on it.
> > > I have achieved this behaviour with a ParentControlDesigner for the
> > > usercontrol and a call of EnableDesignMode für the tabcontrol and each
> > > tabpage.
> > >
> > > With a Smart Tag I add new tabpages to the tabcontrol. If I do so, the
> > > usercontrol does not save this pages in the designer file (or any other
> > > controls on this page). Because of that, the usercontrol looses the controls
> > > when reopen the Form. But if I use the Smart Tag of the tabcontrol, the new
> > > pages are stored in the designer file.
> > >
> > > Does somebody knows what could be wrong?
> > >
> > > Thank you for your answers!
> > > Greetings Johnny
> >