Solved

Tabbednotebook component

Posted on 1999-01-29
4
200 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

Independent Software Vendors: 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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 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