I've added some TTabItem(s) to a TTabControl at runtime. But I can not remove them.
the code I use to create items:
tbi := TTabItem.Create(tbc);
tbi.Parent := tbc;
tbi.Index := tbc.TabCount - 1;
How can I remove those tab items?
I've added some TTabItem(s) to a TTabControl at runtime. But I can not remove them.
the code I use to create items:
tbi := TTabItem.Create(tbc);
tbi.Parent := tbc;
tbi.Index := tbc.TabCount - 1;
How can I remove those tab items?
You can go ahead and directly call either tbi.DisposeOf
or tbc.Tabs[ItemIndex].DisposeOf
.
The call to TTabItem.DisposeOf
will run the destructor code, ensuring a clean removal from the internal tab list.