Solved

Tabbednotebook component

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

22 Experts available now in Live!

Get 1:1 Help Now