Solved

Tabbednotebook component

Posted on 1999-01-29
4
198 Views
Last Modified: 2010-04-06
Hello, I am trying to add a new tabblad on my project and put a richedit on it. (Editor)
Below is my code, this works but when I click on another
tab and go back everything is gone.
The component Tabbednotebook stands in the win3.1 tab of delphi3.
Please help me with this,
Greetz,
Vincent

===========================================================
begin
TabBlad.Pages.add('New');
TabBlad.SetFocus;

with TRichEdit.Create(Self) do
begin
 Parent := TabBlad;
 Align := alClient;
end;
end;
===========================================================
0
Comment
Question by:Vincentg
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 10 total points
ID: 1363830
That's because you need to specify the tab of the notebook as owner to RichEdit. As this is an old control, there is no TabPage property, but you can do it this way:

with TRichEdit.Create(Self) do
begin
 Parent := TTabPage(TabBlad.Pages.Objects[TabBlad.PageIndex]);


0
 

Author Comment

by:Vincentg
ID: 1363831
Thanks Blackman, Can you also tell me how I can rename a on runtime made
tabblad? When I save the tekst it would be nice the tabblad gets the same name.

Thanks again,

Vincent

0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1363832
I think you can use TTabPage(TabBlad.Pages.Objects[TabBlad.PageIndex]).Caption = 'text' but I'm not 100% sure!
0
 

Author Comment

by:Vincentg
ID: 1363833
Hello Blackman,

This doesn't work.. Thanks anyway.. :)

Vincent

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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 …

770 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