Solved

Add/modify/delete a tab

Posted on 1998-10-10
5
312 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
[X]
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
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

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

728 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