Dim FTC , STC As WinForm.TabControl
Dim TopPg , BotPg As WinForm.TabPage
FTC = Forms("窗口1").CreateControl("First" ,ControlTypeEnum.TabControl )
FTC.TabPages.Add("Top1","第一层子页1")
FTC.TabPages.Add("Top2","第一层子页2")
FTC.TabPages.Add("Top3","第一层子页3")
FTC.TabPages.Add("Top4","第一层子页4")
Forms("窗口1").AddControl(FTC)
For Each TopPg In FTC.TabPages
STC = Forms("窗口1").CreateControl("Scond" ,ControlTypeEnum.TabControl )
STC.TabPages.Add("bottom1","第二层子页1")
STC.TabPages.Add("bottom2","第二层子页2")
STC.TabPages.Add("bottom2","第二层子页3")
TopPg.AddControl(STC)
Next