Solved

Add/modify/delete a tab

Posted on 1998-10-10
5
305 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now