Solved

Add/modify/delete a tab

Posted on 1998-10-10
5
307 Views
Last Modified: 2010-04-03
How to add/delete/modify a tab in a TabbedNotebook, a PageControl or a TabControl at runtime?
0
Comment
Question by:elbaid
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
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.

//declaration
    TabSheet1: TTabSheet;

//implementation
    MyTabSheet1 :=TTabSheet.Create(Self);
    MyTabSheet1.PageControl:=PageControl1;

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


0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342519
Sorry, the declaration should be:

MyTabSheet1: TTabSheet;

a small mistake :)
0
 

Author Comment

by:elbaid
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..
0
 

Author Comment

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

Expert Comment

by:dwwang
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.


0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

773 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