Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Add/modify/delete a tab

Posted on 1998-10-10
5
Medium Priority
?
316 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 100 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

885 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