Add/modify/delete a tab

Posted on 1998-10-10
Last Modified: 2010-04-03
How to add/delete/modify a tab in a TabbedNotebook, a PageControl or a TabControl at runtime?
Question by:elbaid
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

dwwang earned 50 total points
ID: 1342518
To add:

Declare a tabsheet object, create it, and set its PageControl property to the pagecontrol component you want to add on.

    TabSheet1: TTabSheet;

    MyTabSheet1 :=TTabSheet.Create(Self);

Then modify it as you usually do,also you can delete it by
free method.


Expert Comment

ID: 1342519
Sorry, the declaration should be:

MyTabSheet1: TTabSheet;

a small mistake :)

Author Comment

ID: 1342520
thats cool for creating somes new tabs but when I want to delete one, the program deletes the last tab available, so I want to be able to delete the one I want, the first, the third, whatever..

Author Comment

ID: 1342521
so the real problem is: i don't know how to call an object created at runtime.

Expert Comment

ID: 1342522
Hi, one good method to do this is use an array of tabs,

   TabArray:array [1..N] of ttabsheet;

then you can use
   tabarray[i]:= TTabSheet.Create(Self);

   and tabarray[i].free; etc.


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi: how to implement a User Shortcut mapper? 1 137
LAN or WAN ? 11 106
How to convert memory stream to PDF file 6 182
Can Live bindings change TGrid Cell Colour ? 1 33
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question